Strip Spanish accents for search, slugs, and keys
Accented characters are correct in written Spanish, but they cause friction in search boxes, URLs, file names, and database keys, where a user typing espanol should still match español. This tool folds Spanish diacritics down to plain ASCII letters — á→a, é→e, í→i, ó→o, ú→u, ü→u — while letting you decide whether to also fold the distinct letter ñ to n.
How it works
The tool uses Unicode NFD normalisation, which decomposes a precomposed
character like á into a base a plus a separate combining acute-accent mark.
It then deletes every combining diacritical mark in the range U+0300–U+036F,
leaving the base letters. The ñ is treated specially: because it is its own
letter rather than an accented n, the tool only folds it to n when you ask it
to, so the default keeps your choice explicit. Case and all non-letter
characters are left untouched.
Tips and example
Mañana iré a la reunión en Málaga with the keep-ñ option off becomes Manana ire a la reunion en Malaga; with keep-ñ on it becomes Mañana ire a la reunion en Malaga. For URL slugs you usually want accents off and ñ folded to n, then
lowercase and replace spaces with hyphens. For accent-insensitive search,
normalise both the query and the stored text the same way before comparing.
Remember that the result is not always a real Spanish word — it is a search and
matching key, not a respelling.