Silk features exceptional mechanical properties such as high tensile strength and great extensibility, making it one of the toughest materials known. The exceptional strength of silkworm and spider silks, exceeding that of steel, arises from beta-sheet nanocrystals that universally consist of highly conserved poly-(Gly-Ala) and poly-Ala domains. This is counterintuitive because the key molecular interactions in beta-sheet nanocrystals are hydrogen bonds, one of the weakest chemical bonds known. Here we report a series of large-scale molecular dynamics simulations, revealing that beta-sheet nanocrystals confined to a few nanometres achieve higher stiffness, strength and mechanical toughness than larger nanocrystals. We illustrate that through nanoconfinement, a combination of uniform shear deformation that makes most efficient use of hydrogen bonds and the emergence of dissipative molecular stick-slip deformation leads to significantly enhanced mechanical properties. Our findings explain how size effects can be exploited to create bioinspired materials with superior mechanical properties in spite of relying on mechanically inferior, weak hydrogen bonds.