External stimuli are powerful tools that naturally control protein assemblies and functions. For example, during viral entry and exit changes in pH are known to trigger large protein conformational changes. However, the molecular features stabilizing the higher pH structures remain unclear. Here we elucidate the conformational change of a self-assembling peptide that forms either small or large nanotubes dependent on the pH. The sub-angstrom high-pH peptide structure reveals a globular conformation stabilized through a strong histidine-serine H-bond and a tight histidine-aromatic packing. Lowering the pH induces histidine protonation, disrupts these interactions and triggers a large change to an extended β-sheet-based conformation. Re-visiting available structures of proteins with pH-dependent conformations reveals both histidine-containing aromatic pockets and histidine-serine proximity as key motifs in higher pH structures. The mechanism discovered in this study may thus be generally used by pH-dependent proteins and opens new prospects in the field of nanomaterials.