Reverse Complement
Reverse complement, complement or reverse a DNA or RNA sequence, with IUPAC codes supported.
AAGCTTAACC GGTTACGCAT
The reverse complement is the sequence of the opposite DNA strand read in its own 5′ → 3′ direction. Complement each base (A↔T, G↔C) and reverse the order: ATGC becomes GCAT. It is the single most-used operation in molecular biology.
Why reverse as well as complement
DNA is antiparallel. The two strands run in opposite directions, so where one reads 5′ → 3′ left to right, its partner reads 3′ → 5′ across the same page. Sequences are always written 5′ → 3′ by convention, so writing down the partner strand means doing two things: swapping each base for its pair, and then reversing the whole string to put it back in the standard direction.
Doing only one of the two is the classic error. The complement of ATGC is TACG, but that is the partner strand written backwards, 3′ → 5′. Reversed, it becomes GCAT, which is what you would actually order from a synthesis company or find in a database.
Where it gets used
Designing the reverse primer for a PCR is the commonest case: the forward primer matches the top strand directly, and the reverse primer is the reverse complement of the region at the other end. It also comes up in reading a gene on the minus strand, checking whether a restriction site is present, finding the partner of an siRNA, and verifying that a sequencing read matches a reference in either orientation.
- 1 Write the sequence out 5′ → 3′. Start from ATGCGTAA.
- 2 Complement each base. A pairs with T and G with C, giving TACGCATT.
- 3 Reverse the result. Read it backwards to get TTACGCAT.
- 4 Check the ends. The first base of the answer pairs with the last base of the original — here T against the final A.
- 5 Confirm by doing it twice. The reverse complement of TTACGCAT is ATGCGTAA again, which is a quick way to catch a slip.
Base pairing
RNA uses uracil in place of thymine; adenine on a DNA template pairs with U in the RNA transcript.
| Base | Pairs with (DNA) | Pairs with (RNA) |
|---|---|---|
| A — adenine | T | U |
| T — thymine | A | A |
| U — uracil | A | A |
| G — guanine | C | C |
| C — cytosine | G | G |
IUPAC ambiguity codes
Used where a position is uncertain or deliberately degenerate; each has its own complement.
| Code | Means | Complement |
|---|---|---|
| R | A or G (purine) | Y |
| Y | C or T (pyrimidine) | R |
| S | G or C (strong) | S |
| W | A or T (weak) | W |
| K | G or T (keto) | M |
| M | A or C (amino) | K |
| N | Any base | N |
Palindromes and other things worth noticing
Some sequences are their own reverse complement. GAATTC, the EcoRI recognition site, reads identically on both strands — which is exactly why restriction enzymes recognise sequences of this kind, since the enzyme binds as a symmetric dimer. GGATCC for BamHI behaves the same way. If a tool returns the sequence you put in, that is usually the reason rather than a bug.
Two practical notes. GC content is unchanged by the operation, because every G becomes a C and vice versa — so the value the tool reports applies equally to both strands. And the ambiguity codes complement in pairs that are easy to get wrong by hand: R and Y swap, K and M swap, while S, W and N are their own complements.