Molecular dynamics simulations with simulated annealing are performed on polyamine-DNA systems in order to determine the binding sites of putrescine, cadaverine, spermidine and spermine on A- and B-DNA. The simulations either contain no additional counterions or sufficient Na+ ions, together with the charge on the polyamine, to provide 73% neutralisation of the charges on the DNA phosphates. The stabilisation energies of the complexes indicate that all four polyamines should stabilise A-DNA in preference to B-DNA, which is in agreement with experiment in the case of spermine and spermidine, but not in the case of putrescine or cadaverine. The major groove is the preferred binding site on A-DNA of all the polyamines. Putrescine and cadaverine tend to bind to the sugar-phosphate backbone of B-DNA, whereas spermidine and spermine occupy more varied sites, including binding along the backbone and bridging both the major and minor grooves.