DNA Reverse Complement
Compute the reverse complement, complement and reverse of a DNA or RNA sequence.
Length: 0 bases
Wallace Tm = 2×(A+T) + 4×(G+C). It is only reliable for oligonucleotides up to about 14 nt; longer sequences need a nearest-neighbour model, which the primer Tm calculator provides with salt correction.
The opposite strand read in the 5’ to 3’ direction. This is the sequence you need for a reverse primer, a probe, or an antisense oligonucleotide.
Every base replaced by its pairing partner, with the original order kept. This is the opposite strand written 3’ to 5’.
The same strand read backwards with no base substitution.
Learn more
What it does
A reverse complement is the sequence produced by reversing a DNA or RNA strand and substituting every base with its pairing partner: A with T, C with G, and A with U in RNA. Because the two strands of a double helix run in opposite directions, the reverse complement is simply the opposite strand written in the conventional 5’ → 3’ direction. That is why it appears constantly in molecular biology. It is how a forward primer is turned into a reverse primer, how an antisense or siRNA sequence is read off a coding strand, and how two sequences are checked to see whether they are the same molecule written from opposite ends. This page returns all three related sequences — reverse complement, complement and reverse — so it is immediately clear which one a given task needs.
How it works
The calculation consists of two independent steps that are easy to conflate. Step one is complementation: walk the sequence and replace each base with its Watson-Crick partner. In DNA, A pairs with T and C pairs with G; in RNA the partner of A is U instead. Step two is reversal: read the complemented string backwards. Applying both steps, in either order, gives the reverse complement, because complementation acts per base while reversal only changes position. The distinction matters because each partial operation is useful on its own: the complement alone is the opposite strand written 3’ → 5’, and the reverse alone is the same strand read from the other end. Degenerate IUPAC codes are complemented as base sets rather than as single letters. R stands for A or G and Y stands for C or T, so R complements Y, because every member of one set pairs with a member of the other. Likewise K (G/T) pairs with M (A/C), B (C/G/T) pairs with V (A/C/G), D (A/G/T) pairs with H (A/C/T), while S (C/G), W (A/T) and N (any base) are self-complementary. Leaving these characters untouched, as many short scripts do, silently produces a wrong answer whenever an ambiguous base is present. Two properties follow directly from those rules. The reverse complement preserves the length of the sequence, and it also preserves GC content, because complementation maps G to C and C to G while A pairs with T or U, so the total number of G and C bases is unchanged and only their positions are reordered. That is why a sequence and its reverse complement have identical GC content and identical Tm estimates.
Worked example
Start with the shortest case: the sequence 5’-ATGC-3’. Complementing it base by base gives 5’-TACG-3’. Reversing the original gives 5’-CGTA-3’. Doing both gives 5’-GCAT-3’, which is the antisense strand written 5’ → 3’. A longer worked case, 5’-ATGGCCTAA-3’: the complement is 5’-TACCGGATT-3’, the reverse is 5’-AATCCGGTA-3’, and the reverse complement is 5’-TTAGGCCAT-3’. Introduce a degenerate base and 5’-ANGC-3’ gives 5’-GCNT-3’, because N pairs with N. Switching to RNA changes the pairing rule: 5’-AUGGCCUAA-3’ has the reverse complement 5’-UUAGGCCAU-3’, where every position that would carry a T in DNA carries a U instead. Running the same input under the DNA rule would write T where U belongs and the result would no longer be an RNA sequence. One case worth noticing is a palindromic site. EcoRI GAATTC and HindIII AAGCTT are each their own reverse complement, which is exactly why these enzymes cut both strands at symmetric positions. A non-palindromic site does not share that property: BsaI GGTCTC reverse-complements to GAGACC, so the two strands carry different sequences and the orientation has to be tracked explicitly when such a site is added to a primer or an insert.
When to use it
Designing PCR primers is the most common use. The forward primer is taken from the coding strand, but the reverse primer has to be the reverse complement of the target region on the opposite strand, so this calculation feeds straight into primer design and ordering. Sequencing primers and probes follow the same logic, as does ordering an antisense oligonucleotide or an siRNA, which must be complementary to the mRNA it is meant to bind. In cloning work the reverse complement is used to verify that an insert sits in the correct orientation and that a restriction site added at one end lands on the intended strand. Sequence records use it to annotate the minus strand, and quick sanity checks use it to confirm that two sequences are the same gene read from opposite ends. Because the operation is its own inverse, applying it twice is also the standard way to prove that a pair of sequences really are reverse complements of one another.
How it compares with other tools
The reverse complement takes only a few lines of code, which is why there are so many online tools for it. What separates them is not whether they can compute it, but a handful of details that are easy to skip. The first is degenerate bases. Most simple implementations carry a four-entry lookup table with A to T and C to G, and return any IUPAC code such as R, Y, K or M unchanged. A single ambiguous base anywhere in the input then makes the whole result wrong, with no warning. This tool complements by base set instead: R (A or G) pairs with Y (C or T), K (G or T) pairs with M (A or C), B (C, G or T) pairs with V (A, C or G), and D (A, G or T) pairs with H (A, C or T), while S, W and N are self-complementary. That matters when designing degenerate primers, which by definition rely on ambiguous positions. The second is keeping DNA and RNA apart. In RNA the partner of A is U rather than T, and mixing the two rules writes T wherever a U belongs. The type is detected automatically here, and it can also be set by hand: a sequence containing U and no T is treated as RNA, or the mode can be locked so the automatic guess cannot disagree with your intent. The third is tolerance for real-world input. Sequences copied out of NCBI or SnapGene often carry line breaks, spaces and FASTA header lines that begin with a greater-than sign. If those characters are treated as bases and reversed along with the rest, the output contains whitespace at meaningless positions. Here the header lines are stripped and all whitespace removed before the calculation, and the interface reports how many headers were ignored and whether any non-IUPAC characters appeared, rather than dropping them silently. The fourth is returning everything in one pass. Whether a given target region should be taken as the reverse complement, the complement or the reverse depends on which end it has to attach to, and it is common to cycle through the three to see which one fits. All three are shown side by side, each with its own copy button, together with length, GC%, Wallace Tm and base counts, so a separate composition page is not needed. Two limits are worth stating. First, this tool transforms sequences only: it does not align them and it does not search a database, so it cannot tell you whether a primer is unique across a genome. That is the job of a primer-BLAST style tool and it requires a sequence database behind it. Second, the Tm shown is the Wallace estimate, 2 x (A+T) + 4 x (G+C), which is reliable only for short oligos of about 14 nt or less. For a salt-corrected or nearest-neighbour thermodynamic Tm, use the primer Tm tool on this site.
FAQ
- What is a DNA reverse complement?
- The reverse complement of a DNA sequence is formed by replacing every base with its pairing partner — A with T, C with G — and then reversing the order. It represents the opposite strand of the double helix written in the standard 5’ → 3’ direction. For the sequence 5’-ATGC-3’ the reverse complement is 5’-GCAT-3’. The operation is its own inverse, so applying it twice returns the original sequence, which makes it a convenient way to verify that two sequences are reverse complements of each other.
- What is the difference between the complement, the reverse and the reverse complement?
- They are three different results from the same input. The complement substitutes bases but keeps the order, so 5’-ATGC-3’ becomes 5’-TACG-3’. The reverse keeps the bases and flips the order, giving 5’-CGTA-3’. The reverse complement does both, giving 5’-GCAT-3’ — and of the three it alone represents the opposite strand read 5’ → 3’. Many scripts quietly return one when you wanted another, which is why this tool shows all three results side by side instead of guessing.
- How does the reverse complement relate to the 5’ and 3’ direction?
- The two strands of a DNA duplex are antiparallel: one runs 5’ → 3’ while its partner runs 3’ → 5’. If the partner strand is written in the conventional 5’ → 3’ direction so that it can be compared directly with the input, the result is the reverse complement. This is also why a forward primer and its paired reverse primer are not simply complements of one another — both are written 5’ → 3’, so the reverse primer equals the reverse complement of the template region the forward primer defines.
- Does the tool handle RNA and ambiguous IUPAC bases?
- Yes. Switch the nucleotide type to RNA, or leave it on auto-detect and let the sequence decide, and A pairs with U instead of T, so 5’-AUGGCC-3’ returns 5’-GGCCAU-3’. Degenerate IUPAC codes are complemented as the base sets they stand for: R pairs with Y, K pairs with M, B pairs with V, D pairs with H, and S, W and N are self-complementary. Characters that are not part of the nucleotide alphabet are copied through unchanged and reported in a warning rather than silently dropped, which matters because removing an ambiguous base shifts every downstream position and corrupts the reading frame of the result.
- Why do I need the reverse complement when designing primers?
- Primer sequences are ordered and reported 5’ → 3’, but the reverse primer binds to the opposite strand. To obtain it, take the template region where the reverse primer should sit and compute its reverse complement; the polymerase then extends from that primer back towards the forward primer. The same reasoning applies to sequencing primers, hybridisation probes and antisense oligonucleotides — all of them must be complementary to their target, so their sequences are all derived by reverse complementing the target region.
- Where do reverse complement calculations usually go wrong?
- Three places. First, performing only one of the two steps — returning the complement when the reverse complement was needed, or the reverse when neither was. Second, discarding ambiguous bases such as N or R, which shifts every position after them and corrupts the result. Third, applying the wrong pairing rule, so an RNA sequence comes back with T where U belongs. This tool performs both steps, complements degenerate codes as base sets, keeps unrecognised characters and flags them, and lets you pin the nucleotide type when auto-detection is not what you want.
- Does the reverse complement change the GC content?
- No. Complementation maps G to C and C to G, and pairs A with T or U, so the total number of G and C bases is exactly the same in the reverse complement — the bases are only reordered. The length is unchanged as well. That is why GC content, and any Tm estimate derived from it, is identical for a sequence and for its reverse complement.
- How does the reverse complement relate to restriction sites?
- Many type II restriction sites are palindromic, which means they are their own reverse complement: EcoRI GAATTC and HindIII AAGCTT are unchanged when you reverse-complement them, and that symmetry is precisely what allows the enzyme to cut both strands at the same position. Non-palindromic sites behave differently — BsaI GGTCTC becomes GAGACC — so their orientation matters and has to be recorded explicitly when one is added to a primer or an insert.
- How do I reverse complement a sequence in Python or Biopython?
- In plain Python, translate the sequence with str.maketrans('ACGTacgt', 'TGCAtgca'), then slice it backwards with [::-1] — two lines, no dependencies. With Biopython, use Bio.Seq: Seq('ATGC').reverse_complement() gives the reverse complement directly, while Seq('ATGC').complement() and [::-1] give the other two results. For RNA, Biopython's generic_rna_complement table pairs A with U, so Seq('AUGC', generic_rna_complement).reverse_complement() works as expected. Watch out for two common bugs: forgetting the reverse step (a complement alone is not the reverse complement), and using a four-letter table that leaves IUPAC codes such as R, Y or N untouched — Biopython's complement() handles those correctly, a hand-written table usually does not.
- Can I do a reverse complement in Excel?
- Yes, with formulas, though Excel has no built-in function. Build the complement with nested SUBSTITUTE calls — for example SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"A","T"),"T","A"),"C","G"),"G","C") — then reverse it with the helper-text trick or, in Microsoft 365, with =TEXTJOIN("",1,MID(B1,SEQUENCE(LEN(B1),,LEN(B1),-1),1)). Older versions need =CONCAT(MID(B1,LEN(B1)-ROW(INDIRECT("1:"&LEN(B1)))+1,1)) entered as an array formula. Paste the sequence into one cell as plain text first, because Excel will silently convert a value such as 1E4 or a date-like string into a number and corrupt the result.