Unicode Text Compare

Compare two strings exactly and by Unicode normalization, code points, grapheme clusters, case handling and invisible characters.

Processed locally in your browser
Exact match No

Case-sensitive, whitespace-sensitive comparison of the exact UTF-16 sequence.

NFC match Yes

Matches after canonical composition. Does not mean the originals are identical.

Grapheme sequence match Yes

Matches by user-perceived character, treating canonically equivalent forms the same.

Lowercase-only match No

Simple lowercase comparison, not full Unicode case folding.

Additional comparison results

Per-input metrics

Text A and Text B measured independently
MetricText AText B

Normalization comparison matrix

Original, NFC, NFD, NFKC and NFKD equality between Text A and Text B, plus whether each input changes under that form.

Match results and per-input change flags by normalization form
FormMatchText A changesText B changes

Line-ending comparison

Unicode normalization does not convert line endings. Counts are reported separately.

Line and paragraph boundary counts
BoundaryText AText B

First difference

Grapheme-level diff

Position is one-based. Invisible or whitespace-only graphemes render as a bracketed code-point label.

Grapheme insertions, deletions and replacements
OperationPosition AGrapheme APosition BGrapheme B
Code-point-level diff
Code-point insertions, deletions and replacements
OperationPosition ACode point APosition BCode point B
Line-level diff (multiline input)
Equal, changed, inserted and removed lines
OperationLine AText ALine BText B

Compare Unicode strings online

This tool compares two original strings exactly, then separately compares their NFC, NFD, NFKC and NFKD normalization forms, their Unicode code-point sequences, their grapheme-cluster sequences, and a lowercase-transformed comparison. It detects invisible-character differences, reports the first difference, and shows line, whitespace and byte metrics. Both inputs are preserved exactly and everything runs locally in the browser.

Unicode normalization comparison example

Text A contains the precomposed character U+00E9. Text B contains U+0065 followed by U+0301 COMBINING ACUTE ACCENT.

Text A: café
Text B: café

Exact match: No. Grapheme sequence match: Yes. Code-point sequence match: No. NFC match: Yes. NFD match: Yes. Text A code points: 4. Text B code points: 5. Text A UTF-8 bytes: 5. Text B UTF-8 bytes: 6.

Exact match vs visual match

Strings can render identically while containing different code points. Exact equality compares the stored UTF-16 sequence exactly as written. Grapheme comparison compares user-perceived character segments and treats canonically equivalent forms as matching. Visual similarity is not guaranteed by either result: fonts and rendering engines can affect appearance, so security-sensitive decisions should not rely on how text looks alone.

NFC, NFD, NFKC and NFKD

NFC and NFD are canonical normalization forms and preserve meaning: NFC composes characters where possible, and NFD decomposes them into a base character plus combining marks. NFKC and NFKD additionally apply compatibility mappings, which can merge distinctions such as fullwidth forms, ligatures, circled characters, superscripts and other presentation forms. A match after any of these forms does not mean the original inputs were identical, and this page always reports whether each input actually changes under each form.

Code points and grapheme clusters

A code point is one Unicode value. A grapheme cluster is a user-perceived character and can contain multiple code points, as combining marks and emoji sequences demonstrate. This tool can show a diff at either level: a code-point diff finds the first Unicode value that differs, while a grapheme diff finds the first user-perceived character that differs, even when it spans several code points. See What Is a Grapheme Cluster? and Code Points vs Code Units.

Case-insensitive and casefold comparison

This tool currently offers a lowercase comparison using JavaScript's lowercase mapping, applied both on its own and combined with NFC and NFKC normalization. This is not the same as full Unicode case folding, which is a locale-independent mapping designed specifically for caseless matching and can behave differently from simple lowercasing for some letters. The lowercase comparison here is clearly labeled as lowercase, not casefold.

Invisible-character differences

Zero-width spaces, joiners, bidirectional controls, special spaces, soft hyphens, variation selectors and control characters are real code points that affect exact and code-point comparisons even though they have little or no visible width. Unicode normalization does not remove most of these characters. Some are meaningful and should not be assumed unwanted. Use the Invisible Character Detector for a detailed, per-character inspection of either string.

First difference and detailed diff

The first difference is reported at the grapheme level, showing the constituent code points on each side. Detailed diffs show insertions, deletions and replacements at the grapheme, code-point and line level, using a proper sequence-diff algorithm rather than lining up positions one by one, so a single insertion does not appear to change every following row. Hidden characters are always shown with a visible, bracketed code-point label.

How to use the comparer

  1. Paste the first string into Text A.
  2. Paste the second string into Text B.
  3. Run the comparison or review live results.
  4. Check exact, normalization, grapheme and case results.
  5. Inspect the first difference and detailed diff.
  6. Copy or download the comparison report.

Common use cases

Privacy and local processing

Comparison runs with JavaScript directly in your browser. Your text is not submitted to UnicodeNow servers.

Frequently asked questions

Why do two identical-looking strings compare as different?

They can be built from different Unicode code points that render the same, such as a precomposed accented letter versus a base letter plus a combining mark, or text with an extra zero-width or non-breaking space.

What is the difference between NFC and NFD?

Both are canonical normalization forms and preserve meaning. NFC composes characters into precomposed forms where possible. NFD decomposes precomposed characters into a base character plus combining marks.

What is the difference between NFC and NFKC?

NFC only applies canonical composition. NFKC also applies compatibility mappings, which can merge distinctions such as fullwidth forms, ligatures, circled characters and superscripts into a more basic representation.

Does Unicode normalization change text?

It can. NFC and NFD preserve canonical equivalence, but NFKC and NFKD can alter or remove formatting distinctions. A match after normalization does not mean the original strings were identical.

What is a grapheme cluster?

A grapheme cluster is what a person usually perceives as one character, such as a letter, an accented letter or an emoji sequence, even when it is made of multiple Unicode code points.

How are code points compared?

Both strings are iterated safely by Unicode code point, avoiding UTF-16 surrogate halves, and compared position by position to find the first point where the sequences diverge.

What is Unicode case folding?

Full Unicode case folding is a locale-independent mapping used for caseless matching that can differ from simple lowercasing for some letters. This tool currently offers lowercase comparison using JavaScript's lowercase mapping, which is not labeled as full case folding.

Can invisible characters make strings different?

Yes. Zero-width spaces, joiners, bidirectional controls and other formatting characters are real code points that affect exact and code-point comparisons even though they have little or no visible width.

Does normalization remove zero-width characters?

No. NFC, NFD, NFKC and NFKD do not remove zero-width spaces, joiners or most other invisible characters. Use the Invisible Character Detector to find and review them.

Are line endings affected by normalization?

No. Unicode normalization does not convert CRLF, CR or Unicode line and paragraph separators to a common form. Line-ending differences are reported separately from normalization results.

Is my text sent to a server?

No. Comparison runs with JavaScript directly in your browser; your text is not submitted to UnicodeNow servers.

Related tools

Inspect hidden code points with the Invisible Character Detector or measure each string with the Unicode Character Counter.

Unicode Character Counter

Count code points, grapheme clusters, words, bytes and invisible characters.

Text ComparisonProcessed locally

Unicode Character Lookup

Search Unicode characters by glyph, code point, name, script or block.

UnicodeServer tool

Unicode Normalizer

Normalize Unicode text to NFC, NFD, NFKC or NFKD.

NormalizationProcessed locally

Unicode Text Cleaner

Normalize, trim and clean problematic Unicode text safely.

Text CleaningProcessed locally

Mixed Script Detector

Detect Unicode writing systems and mixed substantive-script patterns.

SecurityProcessed locally

Related guides

Code Points vs Code Units

Understand Unicode code points, UTF-8 bytes, UTF-16 code units, surrogate pairs, grapheme clusters and why string length can mislead.

What Is a Grapheme Cluster?

Learn how grapheme clusters represent user-perceived characters, why emoji and combining marks affect length, and how to handle text safely.

Unicode Normalization Explained

Learn NFC, NFD, NFKC and NFKD, canonical and compatibility equivalence, and safe normalization for comparison, search and identifiers.