Interactions between nucleic acids and proteins are essential to genetic information processing. The detection of size changes in nucleic acids is the key to mapping such interactions, and usually requires substrates with fluorescent, electrochemical or radioactive labels1–3. Recently, methods have been developed to tether DNA to highly water-soluble Au nanoparticles4–8, and nanoparticle pairs linked by DNA have been used to measure nanoscale distances9. Here we demonstrate a molecular ruler in which double-stranded DNA is attached to a Au nanoparticle. The change in plasmon resonance wavelength of individual Au–DNA conjugates depends on the length of the DNA and can be measured with subnanometre axial resolution. An average wavelength shift of approximately 1.24 nm is observed per DNA base pair. This system allows for a label-free, quantitative, real-time measurement of nuclease activity and also serves as a new DNA footprinting platform, which can accurately detect and map the specific binding of a protein to DNA.