deburr
Removes combining diacritical marks (accents, tildes, cedillas, etc.) from a string while preserving case and non-accented characters. Useful for search, comparison, deduplication, and slug generation in languages that use combining marks (Portuguese, Spanish, French, Vietnamese, etc.).
Try it
Section titled “Try it”Import
Section titled “Import”import { deburr } from "1o1-utils";import { deburr } from "1o1-utils/deburr";Signature
Section titled “Signature”function deburr({ str }: DeburrParams): stringParameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
str | string | Yes | The string to deburr |
Returns
Section titled “Returns”string — The string with combining diacritical marks removed.
Examples
Section titled “Examples”deburr({ str: "café" }); // => "cafe"deburr({ str: "São Paulo" }); // => "Sao Paulo"deburr({ str: "résumé" }); // => "resume"deburr({ str: "naïve façade" }); // => "naive facade"deburr({ str: "Tiếng Việt" }); // => "Tieng Viet"Edge Cases
Section titled “Edge Cases”- Throws if
stris not a string. - Returns the empty string for an empty string input.
- Characters that do not decompose under NFD are left untouched (e.g. German
ß, Turkishı/İ, Polishł). Pair with locale-aware transliteration if you need broader coverage. - Combining marks outside the U+0300–U+036F range are not stripped.
Also known as
Section titled “Also known as”remove accents, strip accents, normalize, ascii fold, transliterate, latinize
Prompt suggestion
Section titled “Prompt suggestion”I'm using 1o1-utils (npm: https://www.npmjs.com/package/1o1-utils, GitHub: https://github.com/pedrotroccoli/1o1-utils, LLM context: https://pedrotroccoli.github.io/1o1-utils/llms.txt). Show me how to use deburr to make a search box accent-insensitive.