Heparin is a linear, anionic polysaccharide that is widely used as a clinical anticoagulant. Despite its discovery 100 years ago in 1916, the solution structure of heparin remains unknown. The solution shape of heparin has not previously been examined in water under a range of concentrations, and here is done so in D2 O solution using small-angle neutron scattering (SANS). Solutions of 10 kDa heparin-in the millimolar concentration range-were probed with SANS. Our results show that when sodium concentrations are equivalent to the polyelectrolyte's charge or up to a few hundred millimoles higher, the molecular structure of heparin is compact and the shape could be well modeled by a cylinder with a length three to four times its diameter. In the presence of molar concentrations of sodium, the molecule becomes extended to nearly its full length estimated from reported X-ray measurements on stretched fibers. This stretched form is not found in the presence of molar concentrations of potassium ions. In this high-potassium environment, the heparin molecules have the same shape as when its charges were mostly protonated at pD ≈ 0.5, that is, they are compact and approximately half the length of the extended molecules.