Dev Helpers

JavaScript / Text and identifiers

Strip combining accents

Dev Helpers · June 9, 2026

Removing combining marks can make a secondary search index more forgiving. Preserve the original spelling in display and storage.

Worked example

console.log("crème brûlée".normalize("NFD").replace(/\p{M}/gu, ""));

Result

creme brulee

Implementation notes

Normalization changes the search key. Two different names can then map to the same value, so index a list of candidates rather than a single winning record.

Try it yourself

Compare composed and decomposed accents and a letter that does not decompose into ASCII.

Open the JavaScript example →

Editorial date June 9, 2026 · Published December 6, 2026

Related articles

Sum distances with a Euclidean norm

A diagonal is longer than either of its components. Math.hypot combines perpendicular distances without making the caller square each input.

Build an OS-independent path

Path conventions belong to the destination. Use an explicit path flavour when generating portable asset names.

Resolve ranked ties

A leaderboard needs an explicit tie policy. Ranking tied scores and sorting their display order are separate decisions.