A prevalent recessive mutation (c.2485C>T, p.Q829X) within the OTOF gene leads to profound prelingual hearing loss. Here we show that in Otof mice harbouring a mutation (c.2482C>T, p.Q828X) homozygous to human OTOF that faithfully mimics the hearing-loss phenotype, a base editor (consisting of the deaminase ABE7.10max and the Cas9 variant SpCas9-NG) packaged in adeno-associated viruses and injected into the inner ear of the mice via the round-window membrane effectively corrected the pathogenic mutation, with no apparent off-target effects. The treatment restored the levels of the otoferlin protein in 88% of the inner hair cells and stably rescued the auditory function of the mice to near-wild-type levels for over 1.5 years while improving synaptic exocytosis in the inner hair cells. We also show that an adenine base editor that targets the prevalent human OTOF mutation restored hearing in humanized mice to levels comparable to those of the wild-type counterparts. Base editors may be effective for the treatment of hereditary deafness.