Reverse complement of DNA and RNA

Sequence direction and strand orientation

DNA/RNA sequences are written by convention from 5′ to 3′. In double-stranded DNA, the two strands are antiparallel, so the “same” region can be represented in two different orientations depending on which strand you read. Reverse complementation puts sequence content from the opposite strand into the same 5′→3′ frame for comparison and downstream use.

Orientation schematic (double-stranded DNA)
Top strand (5′→3′):      5′  A  C  G  T  A  G  C  3′
                             |  |  |  |  |  |  |
Bottom strand (3′→5′):   3′  T  G  C  A  T  C  G  5′

Read bottom strand 5′→3′ (reverse complement of top):

                         5′  G  C  T  A  C  G  T  3′

What is a reverse complement?

The reverse complement of a DNA or RNA sequence is the sequence you would read on the opposite strand, expressed in the standard 5′→3′ direction. Practically, it is produced by swapping bases to their complements and then reversing the resulting string so the output is still written 5′→3′.

Related sequence operations

  • Complement: substitute each base using the chosen alphabet (DNA or RNA), keeping the original order.
  • Reverse: reverse the order of characters without changing bases.
  • Reverse complement:complement and reverse the sequence (the order of these two operations does not affect the final result), so the output is reported 5′→3′.

Examples

DNA example:

Input (5′→3′): GCTTACGA
Complement: CGAATGCT
Reverse: AGCATTCG
Reverse complement: TCGTAAGC

RNA example:

Input (5′→3′): GCUUACGA
Reverse complement: UCGUAAGC

Ambiguous nucleotide symbols

Many datasets include IUPAC ambiguity codes. Reverse complementation can be defined consistently for these symbols as well by complementing the underlying set of bases.

Examples:
  • R (A/G) ↔ Y (C/T in DNA; C/U in RNA)
  • K (G/T in DNA; G/U in RNA ) ↔ M (A/C)
  • W (A/T in DNA; A/U in RNA) ↔ W
  • NN
For full ambiguity codes, see Sequence alphabets and IUPAC codes.

Common bioinformatics use cases

  • Primer and probe design: writing the sequence that binds to the opposite strand.
  • Minus-strand features: inspecting genes or motifs reported on the reverse strand in annotations.
  • Comparative work: matching sequences across references where strand choice differs.
  • Verification: reconciling sequences copied from reports, viewers, or alignment outputs.
Note: Reverse complementation is a string transformation. It does not validate file structure, detect biological plausibility, or resolve annotation context. It operates on the provided characters and requires that the input alphabet (DNA vs RNA, and whether ambiguity symbols are allowed) is already defined.