By the end of this tutorial, you’ll remove accents and diacritical marks from strings using Lodash’s _.deburr() for cleaner search and comparison.
01
Core Syntax
Call _.deburr(string) on any Unicode text.
02
Accent Removal
Converts accented letters to basic Latin equivalents.
03
Search Matching
Match café when users type cafe.
04
Array Mapping
Pass _.deburr directly to .map().
05
vs normalize
Know when native normalize('NFD') is enough.
06
Production Tips
Deburr for search keys, not for displaying proper names.
Fundamentals
What Is _.deburr()?
_.deburr() removes combining diacritical marks from a string, converting accented characters like é into their base Latin forms like e. It is ideal for normalization before search, sort, or equality checks—not for erasing locale-specific spelling that users expect to see on screen.
💡
Beginner tip
Think of _.deburr('résuḿé') as “make this text ASCII-friendly for matching,” not “fix spelling for display.”
International apps use deburr on search indexes, slug generation, and fuzzy matching so users are not punished for omitting accents on their keyboard.
Foundation
📝 Syntax
Pass the string containing accented or decorated characters:
javascript
_.deburr(string)
Syntax Rules
string — the input text with possible diacritics.
Return value — a new string with combining marks stripped.
Latin focus — works on common Latin accented characters; not a full transliteration system.
Non-mutating — the original string is unchanged.
Composable — chain with _.toLower for case-insensitive search keys.
Lodash deburr wraps similar Unicode logic with a consistent API across your app.
Compare
📋 _.deburr vs related operations
Topic
_.deburr
_.toLower
normalize('NFD')
_.trim
Primary job
Strip accents
Lowercase
Decompose Unicode
Trim whitespace
Search helper
Yes
Often paired
DIY pairing
No
Changes meaning
Can (é→e)
Case only
Marks only
Edges only
Display text
Avoid
Sometimes
Avoid
Sometimes
Mutates input
No
No
No
No
🧠 How _.deburr() Works
1
Receive input string
Lodash reads the string argument.
Input
2
Decompose characters
Accented letters are split into base char + combining marks.
Unicode
3
Strip mark code points
Diacritical combining characters are removed.
Filter
4
Recompose result
Base characters are joined into a plain Latin string.
Output
=
📝
Deburred string returned
A normalized copy ready for search indexes, slugs, or equality checks.
Important
📝 Notes
_.deburr() is for matching and indexing, not for replacing proper localized display.
Pair with _.toLower() for case- and accent-insensitive search.
It focuses on Latin accented characters; full transliteration needs dedicated libraries.
The original string is never mutated.
You can pass _.deburr directly to Array.prototype.map.
Import lodash/deburr to keep bundles lean.
Wrap Up
Conclusion
_.deburr() makes international text easier to search and compare by stripping decorative marks while keeping recognizable Latin letters. Use it on queries and indexes, not on user-visible names unless you have a deliberate reason.
Next, learn suffix checking with _.endsWith() for file types, URL paths, and filtered lists.
Use these points when normalizing Unicode text for search and comparison.
5
Core concepts
🔍01
Search
Match cafe and café.
Basics
🌐02
Unicode
Strips combining marks.
Parse
📦03
Indexes
Normalize keys, not display.
Pattern
🔄04
map()
Pass deburr to .map.
API
📝05
endsWith
Next: suffix checks.
Next step
❓ Frequently Asked Questions
_.deburr() removes combining diacritical marks from a string, converting accented Latin characters to their basic forms.
Usually no. Preserve accented spelling in UI. Deburr internal search keys and comparison values instead.
No. Only diacritics are removed. Pair with _.toLower() when you need case-insensitive matching.
No. It targets Latin diacritics. Use dedicated transliteration libraries for other scripts.
_.escape() converts HTML special characters to entities. _.deburr() strips Unicode accent marks.
Yes. items.map(_.deburr) is a common pattern for batch normalization.
Did you know?
Lodash _.deburr() is often paired with _.toLower() in search bars so Café matches cafe. For HTML safety, use _.escape()—deburr only strips accent marks, not tags.