A technique used to determine the three-dimensional structure of molecules, such as proteins or nucleic acids.