Sequence features have long been known to influence the local mechanical properties and shapes of DNA. However, a mechanical code (i.e. a comprehensive mapping between DNA sequence and mechanical properties), if it exists, has been difficult to experimentally determine because direct means of measuring the mechanical properties of DNA are typically limited in throughput. Here we use Loop-seq – a recently developed technique to measure the intrinsic cyclizabilities (a proxy for bendability) of DNA fragments in genomic-scale throughput – to characterize the mechanical code. We tabulate how DNA sequence features (distribution patterns of all possible dinucleotides and dinucleotide pairs) influence intrinsic cyclizability, and build a linear model to predict intrinsic cyclizability from sequence. Using our model, we predict that DNA mechanical landscape shapes nucleosome organization around the promoters of various organisms and at the binding site of the transcription factor CTCF, and that hyperperiodic DNA in C. elegans leads to globally curved DNA segments. By performing loop-seq on random libraries in the presence or absence of CpG methylation, we show that CpG methylation leads to global stiffening of DNA in a wide sequence context, and predict based on our model that CpG methylation widely changes the mechanical landscape around mouse promoters. It suggests how epigenetic modifications of DNA might alter gene expression and mediate cellular adaptation by affecting critical processes around promoters that require mechanical deformations of DNA, such as nucleosome organization and transcription initiation. Finally, we show that the genetic code and the mechanical code are linked: sequence-dependent mechanical properties of coding DNA constrains the amino acid sequence despite the degeneracy in the genetic code. Our measurements explain why the pattern of nucleosome organization along genes influences the distribution of amino acids in the translated polypeptide.