Lab & life science

Primer Tm Calculator: Nearest-Neighbour Tm, GC%, Dimers and Hairpins

Paste your forward and reverse primers (and a probe if you have one) to get the nearest-neighbour melting temperature with salt and Mg²⁺ correction, GC content and a primer-quality checklist: length, GC clamp, runs, 3′-end stability, self-dimers, hairpins and the Tm match between the pair, with a suggested annealing temperature.

✅ No login needed100% freeRuns in your browserYour data stays on your device
Primer Tm and GC% Calculator✅ Free · no login📚 Cite this tool
Your data never leaves your PC. Your data is analysed on your own computer or phone, even when you upload a CSV or Excel file. Nothing is uploaded, stored or seen by Codanics, and no login is needed.
  • PriceFree, no login or sign-up needed
  • Your dataProcessed in your browser, never uploaded
  • Works onPhone, tablet or computer, any modern browser
  • Made byDr. Muhammad Aammar Tufail, Codanics
  • Published17 November 2026
  • Last updated16 November 2026

📚 How to cite this tool

This tool is free. If it helped your thesis, paper, report or assignment, please cite it. It keeps the tools free and helps other students find them.

Citation · APA 7th edition

Tufail, M. A. (2026). Primer Tm calculator: nearest-neighbour Tm, GC%, dimers and hairpins [Online tool]. Codanics. Retrieved 16 November 2026, from https://codanics.com/tools/primer-tm-calculator/

In-text citation: (Tufail, 2026) · Narrative: Tufail (2026)

The access date is today’s date, filled in automatically. Author: Muhammad Aammar Tufail. Published 17 November 2026.

🚀 Follow Codanics channel on WhatsApp for more updatesNew free tools, scholarships, PhD positions and research tips, straight to your phone. Free lessons on YouTube too.

How to use the primer tm and gc% calculator

  1. Paste the forward and reverse primers, 5′ to 3′. Spaces, numbers and lowercase letters are cleaned up for you.
  2. Set the reaction conditions: Na⁺/K⁺, Mg²⁺, dNTPs and primer concentration, or click a preset. Mg²⁺ raises the Tm noticeably.
  3. Read the nearest-neighbour Tm of each primer, the Tm difference and the suggested annealing temperature.
  4. Work through the checklist for each primer and the pair. Redesign primers flagged as Problem, especially 3′-end dimers.

How the melting temperature is calculated

The calculator uses the nearest-neighbour model with the unified parameters of SantaLucia (1998), the same model and salt correction as Primer3 (results match Primer3 to 0.01 °C under the same conditions):

Tm = ΔH° × 1000 / (ΔS° + R ln(C / 4)) − 273.15 ΔS°(salt) = ΔS°(1 M) + 0.368 × (N − 1) × ln[Na⁺eq] [Na⁺eq] = [Na⁺ + K⁺] + 120 × √([Mg²⁺] − [dNTP]) (von Ahsen et al., 2001)

ΔH° and ΔS° are summed over every pair of neighbouring bases plus initiation terms, R = 1.987 cal/(K·mol), C is the oligo concentration and N its length. For self-complementary oligos C/4 becomes C and a symmetry correction is added.

For comparison the table also gives the Wallace rule (Tm = 2 × (A+T) + 4 × (G+C), only for oligos under about 14 nt) and the basic salt-adjusted formula (81.5 + 16.6 log[Na⁺] + 0.41 × %GC − 600/N). They often differ from the nearest-neighbour Tm by several degrees, which is why modern design tools use nearest-neighbour values.

Primer design rules of thumb

PropertyAim for
Length18–30 nt
GC content40–60%
Tm52–68 °C, forward and reverse within 2–5 °C
GC clamp1–3 G or C in the last 5 bases at the 3′ end
Runs and repeatsNo more than 3 identical bases or dinucleotide repeats in a row
Dimers and hairpinsNo stable complementarity, especially at the 3′ end
Annealing temperatureStart 3–5 °C below the lower Tm, then optimise with a gradient
The annealing temperature that works best depends on your polymerase and buffer: high-fidelity enzymes such as Phusion often use Tm + 3 °C with their own Tm calculator. A gradient PCR is the most reliable way to find it. Make up the reaction with the PCR master mix calculator.

Limitations

The dimer and hairpin screen looks for the strongest perfectly complementary run and uses nearest-neighbour ΔG at 37 °C with simple loop penalties. It does not model mismatches, bulges or dangling ends, so treat it as a quick warning system rather than a full secondary-structure prediction. Degenerate (IUPAC) bases are not supported.

Learn the statistics behind these numbers. Codanics has free statistics, R and Python lessons on YouTube and full courses for researchers.

Frequently asked questions

What is the best method to calculate primer Tm?

The nearest-neighbour method, which accounts for the order of bases and the salt and Mg²⁺ in your buffer. Simple formulas such as the Wallace rule can be off by 5 °C or more for typical 20-mers.

Why is my Tm different from another calculator?

Different tools use different parameter sets, salt corrections and default concentrations (for example 50 nM vs 250 nM primer, with or without Mg²⁺). This calculator matches Primer3 when you use the same conditions; click “Primer3 defaults”.

How do I choose the annealing temperature?

Start 3–5 °C below the lower Tm of the two primers and optimise with a gradient PCR. Raise it if you see extra bands; lower it if you get no product.

How much can the two primer Tm values differ?

Ideally within 2 °C, and no more than 5 °C. A large difference forces a low annealing temperature that lets the higher-Tm primer bind non-specifically.

Does Mg²⁺ change the Tm?

Yes. Mg²⁺ stabilises DNA duplexes, so 1.5–2.5 mM Mg²⁺ raises the Tm by several degrees compared with Na⁺ alone. dNTPs bind Mg²⁺, which is why their concentration is also needed.

Are my sequences uploaded?

No. Everything runs in your browser; your primer sequences are never sent anywhere.

Do I need to log in or create an account to use the primer tm and gc% calculator?

No. There is no login, no sign-up and no email required. Open the page and start using it straight away, for free, on any device.

How do I cite this tool in my thesis or paper?

Use the citation box on this page. In APA 7th edition: Tufail, M. A. (2026). Primer Tm calculator: nearest-neighbour Tm, GC%, dimers and hairpins [Online tool]. Codanics. Retrieved [date you used it], from https://codanics.com/tools/primer-tm-calculator/. BibTeX, RIS (EndNote, Mendeley, Zotero), MLA, Harvard, Chicago and Vancouver formats are also available.

Free guides and courses from Codanics

More free tools

See all free Codanics tools → · Codanics on YouTube · WhatsApp channel

Made by Dr. Muhammad Aammar Tufail, Codanics. First published 17 November 2026, last updated 16 November 2026. Found a bug or have an idea for a new tool? Tell us on the WhatsApp channel or in the comments on YouTube. Results are for learning and planning; check important analyses with a statistician or your supervisor.