Base stacking is crucial in nucleic acid stabilization, from DNA duplex hybridization to single-stranded DNA (ssDNA) protein binding. While stacking energies are tiny in ssDNA, they are inextricably mixed with hydrogen bonding in DNA base pairing, making their measurement challenging. We conduct unzipping experiments with optical tweezers of short poly-purine (dA and alternating dG and dA) sequences of 20-40 bases. We introduce a helix-coil model of the stacking-unstacking transition that includes finite length effects and reproduces the force-extension curves. Fitting the model to the experimental data, we derive the stacking energy per base, finding the salt-independent value $\Delta G_0^{ST}=0.14(3)$ kcal/mol for poly-dA and $\Delta G_0^{ST}=0.07(3)$ kcal/mol for poly-dGdA. Stacking in these polymeric sequences is predominantly cooperative with a correlation length of ∼4 bases at zero force . The correlation length reaches a maximum of ∼10 and 5 bases at the stacking-unstacking transition force of ∼10 and 20 pN for poly-dA and poly-dGdA, respectively. The salt dependencies of the cooperativity parameter in ssDNA and the energy of DNA hybridization are in agreement, suggesting that double-helix stability is primarily due to stacking. Analysis of poly-rA and poly-rC RNA sequences shows a larger stacking stability but a lower stacking correlation length of ∼2 bases.