DNA Reverse Complement

Reverse, complement or reverse-complement a DNA or RNA sequence — ambiguity codes and letter case preserved.

Operation
Sequence
Result
Ready. Paste a DNA or RNA sequence.

Your sequence stays on your device. It is transformed in your browser and never uploaded.

FAQ

What is the difference between a complement and a reverse complement?

A complement swaps each base for its pairing partner (A with T, C with G) but keeps the original order, so it reads 3'→5'. A reverse complement also flips the order, handing you the opposite strand back in the familiar 5'→3' direction — the sequence that actually base-pairs with yours.

Why does a reverse PCR primer use the reverse complement?

Primers are written 5'→3'. A reverse primer anneals to the opposite strand at the far end of the target, so you take the sequence at that end and reverse-complement it. The result points back toward the target and is exactly the sequence you order.

Can I paste ambiguity codes like N, R or Y?

Yes. Degenerate IUPAC letters follow their own pairing rules: R swaps with Y, K with M, B with V and D with H, while S, W and N stay unchanged. Letter case is preserved, so lowercase region markers survive.

Does it work with RNA, and what happens to FASTA headers?

Yes. A sequence containing U and no T is treated as RNA, so A pairs with U; otherwise A pairs with T. A leading > name line is kept on top of the result, while spaces, digits and punctuation are cleaned and counted under the input.

Directionality in Molecular Biology and Sequence Transformations

In molecular biology, genetic sequences are written in the standard 5'→3' direction. Because DNA is double-stranded and antiparallel, the two strands run in opposite directions. When analyzing a single strand of DNA or RNA, researchers often need to determine the sequence of the opposite, complementary strand.

To obtain a sequence that both base-pairs with the original strand and reads in the standard 5'→3' direction, a reverse complement transformation is required. This process involves two distinct steps: complementing the bases to their pairing partners, and reversing the order of the sequence.

The order in which these operations are performed does not affect the final output. Mathematically, complementing a sequence and then reversing it yields the exact same sequence as reversing it first and then complementing it.

The DNA Reverse Complement tool provides three distinct operations to manipulate sequences based on your analytical needs:

  • Reverse complement: Swaps each base with its pairing partner and reverses the sequence direction. This produces the opposite strand in the standard 5'→3' orientation.
  • Complement: Swaps each base with its pairing partner but preserves the original 5'→3' order, resulting in a sequence that reads 3'→5'.
  • Reverse: Flips the order of the bases from back to front without changing the base identities.

DNA vs. RNA Base Pairing Rules

The tool automatically detects whether the input sequence is DNA or RNA to apply the correct chemical pairing rules.

  • DNA Detection and Pairing: By default, the tool treats sequences as DNA. Adenine (A) pairs with Thymine (T), and Cytosine (C) pairs with Guanine (G).
  • RNA Detection and Pairing: If the input sequence contains the base Uracil (U) and does not contain Thymine (T), the tool automatically identifies it as RNA. When RNA is detected, the pairing rules adjust so that Adenine (A) pairs with Uracil (U), while Cytosine (C) still pairs with Guanine (G). The interface displays the processing note "RNA detected — A pairs with U." to confirm this mode is active.

IUPAC Degenerate Base Symbols and Case Preservation

Genetic sequences often contain degenerate bases representing genomic variation or ambiguity. The tool fully supports standard IUPAC ambiguity codes and applies specific pairing rules to them:

Input Base Meaning Complement Base
R Purine (A or G) Y
Y Pyrimidine (C or T/U) R
K Keto (G or T/U) M
M Amino (A or C) K
B Not A (C, G, or T/U) V
V Not T/U (A, C, or G) B
D Not C (A, G, or T/U) H
H Not G (A, C, or T/U) D
S Strong (C or G) S (Unchanged)
W Weak (A or T/U) W (Unchanged)
N Any base (A, C, G, or T/U) N (Unchanged)

Letter casing is preserved exactly as entered. If you use lowercase letters to mark specific regions, such as introns or restriction sites, those markers survive the transformation and remain lowercase in the output.

FASTA Format Standards and Character Cleanup

The tool accommodates standard bioinformatics formats and cleans raw sequence data automatically:

  • FASTA Headers: If your sequence begins with a single FASTA header line (starting with >), the tool preserves this name line at the top of the output and displays "Name line kept.". If multiple name lines are detected within the input, the tool merges the sequence lines into a single continuous sequence and displays "‹n› name lines found — sequence lines were joined into one.".
  • Non-Sequence Characters: Spaces, digits, and punctuation marks are automatically stripped from the sequence during processing. The tool displays the count of these removed characters with the message "Ignored ‹n› spaces, digits and punctuation.".
  • Error Handling: If the input contains letters outside the supported DNA/RNA bases and IUPAC codes, the tool displays "Unsupported letters: ‹chars›. Only DNA/RNA base letters are allowed.". If the sequence length exceeds the system limit, it displays "That sequence is too long for this tool. Keep it under ‹max› characters.".

PCR Primer Design Principles

Designing polymerase chain reaction (PCR) primers requires a clear understanding of complementary strands. A PCR assay requires a forward primer and a reverse primer to amplify a target region of DNA.

The forward primer binds to the antisense strand and matches the sense strand sequence in the 5'→3' direction. The reverse primer must bind to the sense strand at the opposite end of the target region. Because DNA polymerase only synthesizes DNA in the 5'→3' direction, the reverse primer must point back toward the target region. To achieve this, you must take the sequence of the sense strand at the far end of your target and generate its reverse complement. This reverse complement sequence is the exact sequence used to order the physical primer.

Privacy and Local Processing

Your sequence stays on your device. It is transformed locally in your browser and is never uploaded to any server. This ensures your sequence data remains entirely within your local environment during analysis.

Frequently Asked Questions

What is the difference between a complement and a reverse complement?

A complement swaps each base for its pairing partner (A with T, C with G) but keeps the original order, so it reads 3'→5'. A reverse complement also flips the order, handing you the opposite strand back in the familiar 5'→3' direction — the sequence that actually base-pairs with yours.

Why does a reverse PCR primer use the reverse complement?

Primers are written 5'→3'. A reverse primer anneals to the opposite strand at the far end of the target, so you take the sequence at that end and reverse-complement it. The result points back toward the target and is exactly the sequence you order.

Can I paste ambiguity codes like N, R or Y?

Yes. Degenerate IUPAC letters follow their own pairing rules: R swaps with Y, K with M, B with V and D with H, while S, W and N stay unchanged. Letter case is preserved, so lowercase region markers survive.

Does it work with RNA, and what happens to FASTA headers?

Yes. A sequence containing U and no T is treated as RNA, so A pairs with U; otherwise A pairs with T. A leading > name line is kept on top of the result, while spaces, digits and punctuation are cleaned and counted under the input.