In the polymerase chain reaction (PCR) technique, DNA is amplified in vitro by a series of polymerization cycles consisting of three temperature-dependent steps: DNA denaturation, primer-template annealing, and DNA synthesis by a thermostable DNA polymerase. The purity and yield of the reaction products depend on several parameters, one of which is the annealing temperature (Ta). At both sub- and super-optimal Ta values, non-specific products may be formed, and the yield of products is reduced. Optimizing the Ta is especially critical when long products are synthesized or when total genomic DNA is the substrate for PCR. In this article we experimentally determine the optimal annealing temperature (TaOPT) values for several primer-template pairs and develop a method for its calculation. The TaOPT is found to be a function of the melting temperatures of the less stable primer-template pair and of the product. The fact that experimental and calculated TaOPT values agree to within 0.7 degree C eliminates the need for determining TaOPT experimentally. Synthesis of DNA fragments shorter than 1 kb is more efficient if a variable Ta is used, such that the Ta is higher in each consecutive cycle.