SeqBench

How to Calculate GC Content of DNA (Formula)

5 min read · Updated June 8, 2026

A 10-base DNA sequence, GCGCATATGC, shown above a horizontal gauge bar filled to 60% to illustrate that 6 of its 10 bases are G or C.GCGCATATGC6 of 10 bases are G or C60% GC content0%60%100%

GC content is the percentage of bases in a DNA or RNA sequence that are guanine (G) or cytosine (C). It is a small number that tells you a lot — about melting temperature, PCR behaviour, and how stable a duplex will be. Here's how to calculate it and why it keeps coming up.

The GC content formula

GC content is simply the count of G and C bases divided by the total number of bases, expressed as a percentage:

GC% = (G + C) / (A + T + G + C) × 100

For example, in the sequence ATGGCATGC there are 9 bases, of which 5 are G or C, giving a GC content of 5 / 9 ≈ 55.6%.

What counts as a 'normal' GC content?

It varies enormously by organism and region. Human genomic DNA averages around 41% GC, but individual genes and regulatory regions can be much higher or lower. Some bacteria sit below 30%, others above 70%. There is no single 'correct' value — what matters is the context of your experiment.

Why GC content matters

  • Melting temperature: G–C pairs have three hydrogen bonds vs. two for A–T, so higher GC means higher Tm and a more stable duplex.
  • Primer design: PCR primers usually target 40–60% GC for reliable, specific annealing.
  • PCR conditions: very high-GC templates can need additives (DMSO, betaine) and higher denaturation temperatures.
  • Sequencing and assembly: extreme GC regions are harder to sequence evenly.

Handling ambiguous bases

Sequences sometimes contain N or other IUPAC ambiguity codes. A careful calculation counts these separately and excludes them from the denominator so the percentage reflects only unambiguous bases — otherwise a run of Ns would silently distort the result.

Worked example: GC content, Tm, and choosing a PCR annealing temperature

GC% by itself is just a percentage — it becomes useful once you feed it into a melting-temperature formula and, from there, an actual annealing temperature you'd set on a thermocycler. Here's the full chain for a realistic 20-nt primer.

Primer (5'→3'): GCGATCCATGGCATCGATCG. Counting bases: G appears 6 times, C appears 6 times, A appears 4 times, and T appears 4 times, for 20 bases total. GC% = (6 + 6) / 20 × 100 = 60%.

Plugging those same counts into the Wallace rule, Tm = 2 × (A + T) + 4 × (G + C), gives Tm = 2 × 8 + 4 × 12 = 16 + 48 = 64°C. Plugging them into the salt-adjusted formula, Tm = 64.9 + 41 × (GC − 16.4) / N, gives Tm = 64.9 + 41 × (12 − 16.4) / 20 = 64.9 + (−180.4) / 20 = 64.9 − 9.02 ≈ 55.9°C.

That's an 8°C gap between the two formulas for the exact same primer. It matters because a common rule of thumb sets the PCR annealing temperature about 5°C below Tm: trusting the Wallace estimate here points you toward roughly 59°C, while trusting the salt-adjusted estimate points you toward roughly 51°C. For a 20-mer, the salt-adjusted figure is the more reliable one — the Wallace rule is only calibrated for short oligos under about 14 nt, and it visibly overestimates once a primer gets longer, exactly as it does in this example.

  1. Count bases: G = 6, C = 6, A = 4, T = 4 (20 total) → GC% = 60%.
  2. Wallace rule: 2 × (4 + 4) + 4 × (6 + 6) = 16 + 48 = 64°C.
  3. Salt-adjusted formula: 64.9 + 41 × (12 − 16.4) / 20 ≈ 55.9°C.
  4. Rule-of-thumb annealing temp (Tm − 5°C): ~59°C from Wallace vs. ~51°C from the salt-adjusted formula — an 8°C difference that would change how the PCR is actually run.

GC content vs. GC skew: two different calculations that both use G and C

GC content and GC skew both involve the letters G and C, which is exactly why they get confused — but they answer completely different questions.

GC content is (G + C) / (A + T + G + C): what fraction of the sequence is G or C overall. It's a single measure of base composition, used for Tm, primer design, and general duplex stability.

GC skew is (G − C) / (G + C): whether G is more common than C on a given strand, independent of how much total G+C there is. It's usually calculated in a sliding window along a genome and plotted as a cumulative sum, because DNA replication tends to enrich G over C on the leading strand — the resulting skew plot flips sign near the origin and terminus of replication, which is exactly how tools locate a bacterial origin of replication in a newly assembled genome. A sequence can have a perfectly ordinary 50% GC content and still show a strong GC skew, because skew depends on the ratio of G to C, not the total amount of G+C.

AT skew, (A − T) / (A + T), is the equivalent calculation for the other base pair and is sometimes reported alongside GC skew for the same origin-finding purpose.

Common mistakes when calculating GC content

  • Copying a sequence straight out of a genome browser or PDF and leaving in position numbers, whitespace, or a FASTA header line (the '>' line) — those characters land in the denominator and quietly drag the percentage away from the true value.
  • Only matching uppercase G/C. Soft-masked repeat regions are often written in lowercase (g, t, a, c) by masking tools, so a case-sensitive count silently drops every lowercase G or C and reports an artificially low GC%.
  • Counting gap characters ('-') from a multiple sequence alignment as part of the total, or treating them as a fifth kind of base — gaps aren't sequence and should be excluded from both the numerator and the denominator.
  • Quoting a genome- or plasmid-wide GC% when the real question is about one primer, amplicon, or exon. A perfectly average 50%-GC sequence can still contain a short, highly GC-rich stretch that forms a hairpin or nonspecific product — the overall percentage hides local extremes.
  • Judging a short primer or small amplicon against a whole-genome 'normal' GC% baseline. Short sequences swing far from the genome average by chance alone, so a 20-mer at 35% or 65% GC isn't necessarily abnormal just because it sits outside the organism's genome-wide figure.

Frequently asked questions

Does GC content include ambiguous bases like N?

Best practice is to exclude N and other ambiguity codes from the calculation and report them separately, so the GC% reflects only the bases that are actually known.

How does GC content relate to melting temperature?

Higher GC content raises the melting temperature because G–C base pairs are held together by three hydrogen bonds compared with two for A–T pairs.

What's the difference between GC content and GC skew?

GC content is (G + C) / total bases — how much of the sequence is G or C. GC skew is (G − C) / (G + C) — whether G is more common than C on a given strand. They're unrelated calculations: content is used for Tm, primer design and PCR conditions; skew is usually computed in a sliding window and plotted cumulatively to locate a genome's replication origin, since G tends to outnumber C on the leading strand near ori.

If two primers have the same GC%, will they have the same Tm?

Not necessarily. Wallace and salt-adjusted formulas only look at the count of G/C vs A/T, so they do give identical results for two primers with the same length and GC%. But real duplex stability also depends on which specific bases sit next to each other (nearest-neighbor stacking energies), so two primers with identical GC% can have measurably different true Tm — something only a nearest-neighbor thermodynamic model captures.

If my primer's overall GC% is in the ideal 40-60% range, is it guaranteed to work well?

No. GC% is an average over the whole primer, so a primer can sit at 50% overall while still containing a short GC-rich stretch that forms a hairpin or self-dimer, or an AT-rich 3' end that anneals too weakly to extend efficiently. Check the local sequence and secondary structure near the 3' end, not just the whole-primer percentage.

Related references

Related tools

Related guides