IUPAC Nucleotide Ambiguity Codes: Full Table
5 min read · Updated June 10, 2026
Sooner or later you hit a sequence full of letters that aren't A, C, G or T — an R here, a Y there, a run of Ns. These are IUPAC ambiguity codes, a standard shorthand for 'one of several possible bases' at a position. This guide is a quick reference to what each one means and where they come from.
Why ambiguity codes exist
A single letter sometimes has to stand for more than one base. It might be a position that varies across a population (a SNP), an uncertain base call from sequencing, or a deliberately degenerate position in a primer or a binding-site consensus. Rather than guess, the IUPAC codes record exactly which bases are possible at that spot.
The two-base codes
- R = A or G (puRine)
- Y = C or T (pYrimidine)
- S = G or C (Strong, three H-bonds)
- W = A or T (Weak, two H-bonds)
- K = G or T (Keto)
- M = A or C (aMino)
The three- and four-base codes
- B = C, G or T (not A)
- D = A, G or T (not C)
- H = A, C or T (not G)
- V = A, C or G (not T)
- N = A, C, G or T (aNy base)
Complements of ambiguity codes
When you take a reverse complement, each ambiguity code maps to another code, not just A↔T and G↔C. R (A/G) complements to Y (T/C), W and S are self-complementary, K complements to M, and the three-base codes pair up B↔V and D↔H, while N stays N. A reverse-complement tool has to handle the whole alphabet to be correct.
- R ↔ Y, K ↔ M, B ↔ V, D ↔ H
- S ↔ S, W ↔ W, N ↔ N (self-complementary)
Where you'll meet them
- Degenerate PCR primers designed to amplify a family of related sequences.
- Restriction enzyme recognition sites with variable positions (e.g. HinfI, G^ANTC).
- Consensus/binding-site motifs written as a single degenerate string.
- Sequencing reads, where N marks a base the basecaller couldn't determine.
Worked example: writing one degenerate primer for a peptide
Because most amino acids are encoded by more than one codon, you can sometimes compress a whole family of DNA sequences that all encode a given peptide into a single IUPAC-coded primer. Take the 4-residue peptide Met-Phe-Asp-Gly (M-F-D-G) and look up each amino acid's codon(s) in the standard genetic code.
Concatenating the results gives the degenerate primer 5'-ATGTTYGAYGGN-3' (12 nt). The two Y's each stand for 2 possible bases and the N for 4, so this one written sequence represents 2 × 2 × 4 = 16 distinct real 12-mers — and every one of those 16 translates back to exactly Met-Phe-Asp-Gly, because each ambiguity code here was built only from codons that are genuinely synonymous for that residue.
- Met (M): only one codon, ATG — no ambiguity needed.
- Phe (F): TTT or TTC — the third position is C or T, which is Y, giving TTY.
- Asp (D): GAT or GAC — again C or T at the third position, giving GAY.
- Gly (G): GGT, GGC, GGA or GGG — all four bases appear at the third position, which is N, giving GGN.
IUPAC nucleotide codes vs. amino acid codes — same letters, unrelated meanings
Nucleotide ambiguity codes and the standard single-letter amino acid alphabet were both defined by IUPAC, and they draw from the same 26 letters — which means every one of the 11 ambiguity codes below is also a valid, completely unrelated amino-acid letter.
In practice this means a garbled or misrouted sequence rarely gets caught automatically: a degenerate DNA primer full of R's, Y's and N's is also a 'legal' string of amino-acid letters, so pasting it into a tool expecting protein input doesn't error out — it just silently produces a meaningless result. Check which alphabet a sequence is actually written in before trusting what a tool does with it.
- R — A or G in DNA/RNA; Arginine in a protein sequence
- Y — C or T in DNA/RNA; Tyrosine in a protein sequence
- S — G or C in DNA/RNA; Serine in a protein sequence
- W — A or T in DNA/RNA; Tryptophan in a protein sequence
- K — G or T in DNA/RNA; Lysine in a protein sequence
- M — A or C in DNA/RNA; Methionine in a protein sequence
- B — C, G or T in DNA/RNA; Asx (Asn or Asp) in a protein sequence
- D — A, G or T in DNA/RNA; Aspartate in a protein sequence
- H — A, C or T in DNA/RNA; Histidine in a protein sequence
- V — A, C or G in DNA/RNA; Valine in a protein sequence
- N — any base in DNA/RNA; Asparagine in a protein sequence
Common mistakes with ambiguity codes
- Assuming any amino acid's codons can be compressed into one IUPAC-coded triplet the same way. Leucine has six codons split across two unrelated groups — TTA/TTG and CTT/CTC/CTA/CTG. Merging them position-by-position gives Y-T-N (YTN), which expands to 8 triplets (CTA, CTC, CTG, CTT, TTA, TTC, TTG, TTT) — but TTC and TTT are actually Phe codons, not Leu. Leucine, Arginine and Serine all split this way and need two separate degenerate oligos, not one.
- Reading an ambiguity code inside a restriction site as 'this sequence or that sequence' rather than 'this one position varies.' HinfI's site G^ANTC is a single 5-base pattern where positions 1, 2, 4 and 5 are fixed and only position 3 varies — it matches four real sequences (GAATC, GACTC, GAGTC, GATTC) simultaneously, not two alternative whole sites.
- Treating an N from a sequencing read as if it were a genuine mixed base with known proportions. It almost always just means 'the base caller couldn't tell' — feeding it into a GC%, Tm or translation calculation as though it were a real, quantifiable mixture (the way a deliberately synthesized degenerate primer position is) will silently distort the result.
Frequently asked questions
What does N mean in a DNA sequence?
N is the IUPAC code for any base — A, C, G or T. It often marks a position where the base is unknown (an ambiguous sequencing call) or deliberately variable (as in a degenerate primer).
What is the complement of R in a reverse complement?
R (A or G) complements to Y (T or C). Ambiguity codes have their own complements: K↔M, B↔V, D↔H, while S, W and N are self-complementary.
Can every amino acid's codons be written as one degenerate IUPAC codon?
No. Most can — Gly compresses cleanly to GGN and Phe to TTY, for example. But Leucine, Arginine and Serine each have six codons split across two unrelated groups (Leu's codons are TTA/TTG plus CTT/CTC/CTA/CTG), so merging them position-by-position into a single triplet like YTN also matches codons for a different amino acid (Phe). Those three need two separate degenerate primers, not one.
Are IUPAC nucleotide ambiguity codes the same as amino acid one-letter codes?
No, though they use the same letters. Every one of the 11 nucleotide ambiguity codes (R, Y, S, W, K, M, B, D, H, V, N) is also a standard amino-acid letter with a completely unrelated meaning — R is 'A or G' in a DNA sequence but Arginine in a protein sequence. Tools don't always flag the mismatch if a sequence lands in the wrong field, so check which alphabet is expected.
How many actual DNA sequences does a string of ambiguity codes represent?
It depends on how many ambiguous positions are strung together, since the choices at each position multiply. Each two-base code (R, Y, S, W, K, M) contributes a factor of 2 and each N a factor of 4 — a primer written as GGN represents 4 real sequences, while one written as TTYGAYGGN (two Y's and one N) represents 2 × 2 × 4 = 16.
Related references
Nucleotide ambiguity codes and their complements.
Common restriction enzymes: recognition sites, cut positions, NEB buffer activity, star activity and an interactive double-digest buffer finder.
Selection markers, mechanisms and working concentrations for cloning.