Accent Fold (Search Normaliser)

Fold accented letters to ASCII base for search matching

Fold accented and diacritical characters to their plain ASCII bases so search queries match regardless of accents. Combines NFD stripping with ligature expansion. Runs entirely in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is accent folding?

Accent folding maps accented characters to their unaccented ASCII equivalents so that café and cafe are treated as the same term. Search engines apply it on both the index and the query so users find results regardless of how they type accents.

Accent folding normalises text so that searches match regardless of accents and special letters. It is the standard preprocessing step behind diacritic-insensitive search, where café and cafe are treated as identical.

How it works

Two stages produce a clean ASCII key:

1. Expand special letters and ligatures that have no combining mark:
   ß → ss   æ → ae   œ → oe   ø → o   ð → d   þ → th   ł → l
2. Normalise to NFD and delete combining marks (U+0300–U+036F):
   é → e   ñ → n   ü → u
   (optionally) lowercase the whole string

Doing the ligature expansion before the NFD strip ensures characters that NFD cannot decompose still become plain ASCII. Apply the same pipeline to both your search index and the incoming query.

Worked examples

InputFolded output
Mötley Crüe — Straßemotley crue strasse
café au laitcafe au lait
Zoë & Chloézoe & chloe
Łódź, Polskalodz, polska
Þór Björnssonthor bjornsson
São Paulosao paulo

Where this matters in real projects

Name search. A user database containing “Ångström” will not match a search for “Angstrom” without folding. Apply the same normaliser at indexing time and at query time so both sides of the comparison are in the same form.

Address matching. Addresses imported from international sources often contain diacritics (Köln, Málaga, Łódź). Fuzzy address matching and deduplication pipelines routinely fold before comparing.

URL slugs. Before slugifying a title like “Über-cool résumé tips,” fold the accents first to get “uber-cool resume-tips” — clean, ASCII-safe URL path segments.

Database LIKE queries. Postgres and MySQL can be configured for case-insensitive collations, but accent-insensitive collations are less universal. Storing a pre-folded search column alongside the display column is a portable, engine-agnostic approach.

Log and metric aggregation. Event names, product names, or city names scraped from multiple sources arrive in inconsistent casing and accent forms. Folding before grouping collapses duplicates that would otherwise inflate your metric counts.

Common mistakes

  • Folding only the stored value, not the query — if a user types “café” and you search a folded index of “cafe,” the comparison still fails. Always fold both sides.
  • Using NFD strip alone without ligature expansion — pure NFD normalisation leaves ß as ß (it is not decomposable). The ligature expansion step must come first.
  • Over-folding for display — fold only for search keys and comparison, never for the displayed result. Users expect to see “Müller” in results, not “muller.”