Variations on DNA sequences profoundly affect how we develop diseases and respond to pathogens and drugs. Atomic force microscopy (AFM) provides a nanomechanical imaging approach for genetic analysis with nanometre resolution. However, unlike fluorescence imaging that has wavelength-specific fluorophores, the lack of shape-specific labels largely hampers widespread applications of AFM imaging. Here we report the development of a set of differentially shaped, highly hybridizable self-assembled DNA origami nanostructures serving as shape IDs for magnified nanomechanical imaging of single-nucleotide polymorphisms. Using these origami shape IDs, we directly genotype single molecules of human genomic DNA with an ultrahigh resolution of similar to 10nm and the multiplexing ability. Further, we determine three types of disease-associated, long-range haplotypes in samples from the Han Chinese population. Single-molecule analysis allows robust haplotyping even for samples with low labelling efficiency. We expect this generic shape ID-based nanomechanical approach to hold great potential in genetic analysis at the single-molecule level.