There are two algorithms for melting temperature calculation:

Note, that Rough works only for DNA alphabet, it does not work for DNA extended and RNA alphabets. Primer3 works for all extended alphabets.

Rough

The melting temperature is calculated as follows. For sequences of length 15 or longer:

Tm 64.9 + 41 * (nG + nC - 16.4) / (nA + nT + nG + nC)

For shorter sequences:

Tm = (nA + nT) * 2 + (nG + nC) * 4

Here "nA", "nT", "nC", "nG" denote the number of the corresponding nucleotide.

Primer 3

This calculation algorithm is borrowed from the Primer3 package. The algorithm uses the nearest-neighbor (NN) model or the formula from Bolton and McCarthy, PNAS 84:1390 (1962) (as presented in Sambrook, Fritsch and Maniatis, Molecular Cloning, p 11.46 (1989, CSHL Press)). The algorithm has the following parameters: