Skip to main content
I
Uni
UNICODE
Tools/Unicode Normalization

Unicode Normalization Studio (NFC • NFD • NFKC • NFKD)

Inspect canonical equivalence and compatibility decomposition across all 4 Unicode Technical Report #15 normalization forms in real time.

Input String to Normalize
NFC — Canonical CompositionW3C & Web Standard

Decomposes characters and recombines them into precomposed canonical single codepoints. Default for web, HTML5, and Linux.

Café résumé: 2⁵ = 32, file № 42, ㌀, ½ cup.
Length: 41 codepointsSize: 53 UTF-8 bytes
NFD — Canonical DecompositionmacOS / HFS+ Standard

Separates base letters from their combining diacritical marks (e.g. "é" becomes "e" + "◌́"). Standard for Apple macOS file systems.

Café résumé: 2⁵ = 32, file № 42, ㌀, ½ cup.
Length: 44 codepointsSize: 56 UTF-8 bytes
NFKC — Compatibility CompositionSearch & IDN Standard

Replaces formatting variations (ligatures "fi" → "fi", superscripts "²" → "2", fractions "½" → "1/2") and recomposes canonically. Essential for search engines.

Café résumé: 25 = 32, file No 42, アパート, 1⁄2 cup.
Length: 48 codepointsSize: 61 UTF-8 bytes
NFKD — Compatibility DecompositionNLP & AI Preprocessing

Applies compatibility decomposition without recombining. Ideal for OCR, natural language processing, and fuzzy text matching.

Café résumé: 25 = 32, file No 42, アパート, 1⁄2 cup.
Length: 52 codepointsSize: 67 UTF-8 bytes

Character Canonical Decomposition Breakdown

See which characters in your input string are precomposed canonical letters versus combining sequences.

CU+0043
aU+0061
fU+0066
éU+00E9U+0065 + U+0301
U+0020
rU+0072
éU+00E9U+0065 + U+0301
sU+0073
uU+0075
mU+006D
éU+00E9U+0065 + U+0301
:U+003A
U+0020
2U+0032
U+2075
U+0020
=U+003D
U+0020
3U+0033
2U+0032
,U+002C
U+0020
U+FB01
lU+006C
eU+0065
U+0020
U+2116
U+0020
4U+0034
2U+0032
,U+002C
U+0020
U+3300
,U+002C
U+0020
½U+00BD
U+0020
cU+0063
uU+0075
pU+0070
.U+002E

Unicode Normalization (NFC, NFD, NFKC, NFKD)

Using standard library unicodedata for canonical normalization.

1import unicodedata
2
3text = "é (e + combining acute)" # Can be composed or decomposed
4
5# 1. NFC (Canonical Composition - Web standard)
6nfc = unicodedata.normalize('NFC', text)
7
8# 2. NFD (Canonical Decomposition)
9nfd = unicodedata.normalize('NFD', text)
10
11# 3. NFKC (Compatibility Composition)
12nfkc = unicodedata.normalize('NFKC', text)
13
14# 4. NFKD (Compatibility Decomposition)
15nfkd = unicodedata.normalize('NFKD', text)
16
17print(f"NFC Length: {len(nfc)} | NFD Length: {len(nfd)}")
Python 3Zero external runtime dependencies • Standard Library
UTF-8 & Unicode 16.0 Compatible

Deep Dive into Unicode Technical Report #15: The Four Normalization Forms

In the Unicode standard, two sequences of code points are considered canonically equivalent if they represent the exact same abstract character and must be displayed with identical appearance and typography. For example, the character é can be encoded as a single precomposed character (U+00E9) or as a two-character combining sequence (base letter U+0065 ‘e’ followed by combining acute accent U+0301).

Without proper normalization, binary equality checks in JavaScript ('\u00E9' === 'e\u0301') return false! This creates catastrophic security vulnerabilities (such as authentication bypasses), corrupted database uniqueness constraints, and broken full-text search engines.

Which Form Should You Use?

NFC (Recommended for 95% of use cases):Default for HTML5, XML, JSON, SQL databases, and W3C web standards. Minimizes memory and byte storage.
NFKC (Recommended for Search & IDNs):Best for search engines, user query normalization, domain name registries, and username deduplication.

Frequently Asked Questions (FAQs)

How does NFKC handle mathematical symbols and font ligatures?+

NFKC performs compatibility decomposition. It converts stylized font variations (like 𝔉 Fraktur or 𝐁 Bold) into standard ASCII letters, resolves ligatures like "fi" into "f" + "i", and turns superscript numbers "²" into standard digits "2".

Can Unicode normalization change the meaning of my text?+

Canonical normalization (NFC and NFD) never alters text semantics. Compatibility normalization (NFKC and NFKD), however, intentionally strips stylistic formatting (e.g. converting fraction ½ into 1/2), which is ideal for search indexing but not for preserving original typographical formatting.

How do I perform normalization in Python or Node.js?+

In JavaScript / Node.js, use string.normalize("NFC"). In Python, use import unicodedata; unicodedata.normalize("NFC", text).