Guide

What Is a Reverse Complement?

The reverse complement of a DNA sequence is the sequence of its partner strand, written in the standard 5′→3′ direction. Swap each base for its pair (A↔T, G↔C), then reverse the order.

By DNARev · Published

Why DNA Has a Reverse Complement

A DNA molecule is two strands held together by base pairs: adenine (A) pairs with thymine (T), and guanine (G) pairs with cytosine (C). Each strand has a direction, named after the carbon atoms of its sugar backbone: one end is 5′ (five prime) and the other is 3′ (three prime).

The two strands run in opposite directions, which is called antiparallel. By convention, sequences are always written and read from 5′ to 3′. So once you know one strand, the other strand is fully determined, but to write it the standard way you have to read it backwards.

The two strands of a short DNA sequence Top strand 5′ ATGCCGTAA 3′ pairs base by base with the bottom strand 3′ TACGGCATT 5′. Reading the bottom strand from its 5′ end gives TTACGGCAT, the reverse complement. Your sequence (top strand), read left to right 5′ ATGCCGTAA 3′ 3′ TACGGCATT 5′ Partner strand read from its own 5′ end: TTACGGCAT, the reverse complement
DNA strands are antiparallel. The partner strand runs 3′→5′ under your sequence, so reading it the standard way (5′→3′) means reading it right to left.

How to Work It Out by Hand

  1. Write the complement. Replace every A with T, T with A, G with C and C with G.
  2. Reverse it. Write the result from the last base to the first.
  3. Label the ends. The result starts at 5′ and ends at 3′.

For 5′-GATTACA-3′, the complement is CTAATGT and the reverse complement is 5′-TGTAATC-3′. Doing the two steps in the other order (reverse first, then complement) gives the same answer.

Reverse, Complement and Reverse Complement

The three operations are easy to mix up. Here they are side by side for ATGCCGTAA:

Three operations on ATGCCGTAA
OperationResultWhat it means
ReverseAATGCCGTAThe same strand read backwards (3′→5′). Rarely what you want.
ComplementTACGGCATTThe partner strand, written 3′→5′ so it lines up under the original.
Reverse complementTTACGGCATThe partner strand written 5′→3′. This is the one most tools and databases expect.

Where You Need It

PCR Primers

A PCR reaction uses a forward primer that matches the top strand and a reverse primer that binds to the top strand near the far end of the target. The reverse primer is therefore the reverse complement of that stretch of top-strand sequence. If the end of your target reads 5′-CTGACCTAGGTTCAAG-3′, the reverse primer is 5′-CTTGAACCTAGGTCAG-3′.

Sequencing Reads and Search Hits

Reads and BLAST hits can come from either strand. A hit on the minus strand matches the reverse complement of your query, so comparing it by eye means converting one of them first.

Restriction Sites

Many restriction enzymes recognise palindromic sites: sequences that equal their own reverse complement. EcoRI’s site GAATTC and BamHI’s site GGATCC both read the same on either strand.

Probes and Antisense Sequences

A probe or antisense oligonucleotide must pair with its target, so it is designed as the reverse complement of the target sequence.

RNA

RNA uses uracil (U) instead of thymine, so A pairs with U. The reverse complement of 5′-AUGGCU-3′ is 5′-AGCCAU-3′. In DNARev, choose RNA as the sequence type to complement A↔U. In DNA mode, U is treated as an invalid character and removed, which is how the original Sequence Manipulation Suite behaves.

RNA can also form G–U “wobble” pairs inside folded structures, but a reverse complement always uses the standard Watson–Crick pairs.

Ambiguity (IUPAC) Codes

When a position is uncertain, sequences use IUPAC codes. Each code has a defined complement:

IUPAC nucleotide codes and their complements
CodeMeansComplement
RA or G (purine)Y
YC or T (pyrimidine)R
KG or TM
MA or CK
SG or CS
WA or TW
Bnot AV
Vnot TB
Dnot CH
Hnot GD
Nany baseN

DNARev keeps N but removes the other ambiguity codes, exactly as the Sequence Manipulation Suite does, and shows a note when that happens. Check the length of the result if your input contains them.

In Python

For plain DNA, a translation table and a slice are enough:

def reverse_complement(seq):
    pairs = str.maketrans("ACGTNacgtn", "TGCANtgcan")
    return seq.translate(pairs)[::-1]

print(reverse_complement("ATGCCGTAA"))  # TTACGGCAT

With Biopython, use the methods on Seq:

from Bio.Seq import Seq

Seq("ATGCCGTAA").reverse_complement()   # Seq('TTACGGCAT')
Seq("AUGGCU").reverse_complement_rna()  # Seq('AGCCAU')

Common Mistakes

  • Reversing without complementing, or complementing without reversing. Only the reverse complement gives the partner strand in 5′→3′ order.
  • Dropping the direction labels. Without 5′ and 3′, nobody can tell which way a sequence was written.
  • Mixing T and U. Use DNA rules for DNA and RNA rules for RNA.
  • Pasting several FASTA records at once. Many tools merge them into one sequence. In DNARev, turn on Each record separately to keep every record and its header.

Convert your own sequence in seconds.

Open the reverse complement tool