About this tool
Unicode Normalization (Unicode Standard Annex #15) resolves character identity ambiguities across database queries, security authentication, and search indexing. In Unicode, visually indistinguishable characters (such as accented `é`) hold two legitimate binary representations: a precomposed code point (`U+00E9`) or a decomposed sequence of base letter `e` plus combining accent (`U+0065` + `U+0301`). To human eyes they are identical, but binary comparisons (`str1 === str2`) evaluate to `false`! This tool converts text into NFC, NFD, NFKC, and NFKD forms locally.
How to Use This Tool (Step-by-Step)
Paste Raw Text
Paste your text containing accented characters, ligatures, full-width CJK symbols, or circled numbers into the editor.
Select Normalization Form
Choose your target standard: NFC (Standard Canonical Composition, Web default), NFD, NFKC (Compatibility Composition), or NFKD.
Inspect Hex Bytes & Copy Text
The normalized string renders immediately alongside detailed hexadecimal code-point mappings. Copy clean text with one click.
All 4 Official Unicode Normalization Forms
Full compliance across NFC, NFD, NFKC, and NFKD standards, aligned with modern browser engines and database query planners.
Full-Width & Compatibility Fold
NFKC folds compatibility forms: seamlessly normalizes circled numbers (`①` to `1`), ligatures (`fi` to `fi`), and full-width ASCII.
100% Client-Side Air-Gapped
Transformations run entirely via browser-native C++ normalization routines with zero network exposure.
Unicode Normalization Best Practices & Tips
- •macOS NFD filename disaster: macOS filesystem enforces NFD decomposed paths, clashing with Linux NFC defaults and confusing Git status tracking.
- •Prevent username spoofing: Attackers register visual duplicates using NFD decomposed characters to bypass unique database constraints.
- •Boost search recall via NFKC: NFKC collapses roman numerals, ligatures, and full-width punctuation to standard search tokens.
Code & Transformation Examples
Four Normalization Forms Architecture Benchmark
• NFC : Canonical Decomposition, followed by Canonical Composition (推荐 Web 默认)
• NFD : Canonical Decomposition (全部拆开为基础字符+变音符组合)
• NFKC : Compatibility Decomposition, followed by Canonical Composition (最强归一化)
• NFKD : Compatibility Decomposition (兼容拆分)• 带有重音符的 "é" :
NFD 拆解为: e + ◌́ (2 个独立码点: U+0065 + U+0301)
NFC 合成为: é (1 个独立码点: U+00E9)
• 特殊符号 "①" 经 NFKC 规范化后变为: "1"
• 连字 "fi" 经 NFKC 规范化后变为: "fi"* W3C explicitly mandates NFC as the standard canonical interchange format for all web content.
JavaScript Native normalize() Implementation Snippet
const str1 = "\u00E9"; // precomposed: "é"
const str2 = "e\u0301"; // decomposed: "é"
console.log(str1 === str2); // 惊人报错: false! (虽然看着完全一样)
// 修复方案: 统一转为 NFC 规范化
console.log(str1.normalize('NFC') === str2.normalize('NFC')); // true!// 用户在搜索框搜 "1",想匹配到数据库里的 "①"
"①".normalize('NFKC'); // 输出: "1" (匹配成功!)
"ABC".normalize('NFKC'); // 输出: "ABC" (全角转半角!)* Normalizing strings via NFC prior to password hashing is a mandatory security best practice.
Frequently Asked Questions
Q: Why do identical-looking strings evaluate to false in code?
A: JavaScript compares underlying binary code point streams, not visual glyphs. A 1-codepoint character does not match a 2-codepoint sequence.
Q: Is NFKC normalization reversible?
A: No. NFKC compatibility folding is lossy and irreversible; turning `①` into `1` discards styling context permanently.
Q: Does normalization alter standard Chinese characters?
A: Standard CJK ideograms are precomposed stable points and remain 100% untouched under NFC. Only compatibility duplicates fold gracefully.