Unicode NFKC Normalizer

Paste text and get it back in NFKC, with joined-up letters, raised digits and wide letters made ordinary.

FluffyShield Protected workspace
FluffyShield

Isolated workspace: other page scripts can't read your files. How FluffyShield works

Free · No upload · No sign-up · No usage quotas

Why can't you find a word in text copied from a PDF?

The letters may not be what they look like. A PDF can hand over fi or fl as one joined-up character, and a search for the two letters doesn't find it.

What NFKC changes
  1. Find characters that are only a styled form of others
  2. Write each one as the plain characters it stands for
  3. Join accents to their letters, as NFC does

What it does

Wide letters go narrow

ABC-123, in the wide letters that sit square beside Chinese or Japanese characters, becomes ABC-123.

½ isn't 1/2

½ comes out as 1⁄2, with a fraction slash between the digits, a character of its own and not the / on your keyboard. A search for 1/2 still misses it.

Accents stay on

café straße comes through as it is. NFKC makes text plainer, not English.

Limits Capitals stay as they are, and so does an invisible zero-width space.

A flat listing the search box can't find

A line copied out of a PDF of a flat listing reads first floor, 54 m². Paste it into your notes, search them for floor, and nothing comes up, though the word is right there.

Printers have long joined certain pairs of letters into one shape, because the hook of an f bumps into the letter after it. These joined shapes are called ligatures, and Unicode gives the common ones code points of their own, the numbers it uses to store each character. The fl in that line is a single code point, U+FB02. The search is looking for an f followed by an l, and the text has no such pair.

What NFKC straightens out, and the ² it takes with it

NFKC is short for Normalization Form KC, and the K stands for compatibility: it counts a styled character and its plain version as the same thing, and keeps the plain one. Run the line through it and the search for floor works.

Copied from the PDF16 code pointsfirst floor, 54 m²After NFKC18 code pointsfirst floor, 54 m2

Before and after NFKC

The tinted boxes are the characters NFKC changed: two joined pairs, which come apart into letters, and the raised 2. How we checked

The same pass flattens the square metres. A raised ² is a styled 2 as far as Unicode is concerned, so it becomes a plain one. In a floor area that's harmless. In a number it isn't: 10², ten squared, comes out as 102.

It's like retyping a printed page on an old typewriter. Every word makes it across, but the small raised figures drop onto the line with the rest, and the new page can't tell you which ones they were.

Unicode's own description of the form, Standard Annex #15, warns that it mustn't be applied blindly, because it erases distinctions that can matter to what a text means. So use NFKC for a copy you search or compare, and keep the original for anything you quote or print.

Making a copy you can search

The box is FluffyBench's Unicode inspector set to NFKC, and your pasted line stays as it was in Input.

  1. Paste the line you copied from the PDF into the Input box.

  2. Take the plain copy from the NFKC box with Copy; a phone keeps it under the Result tab.

    The NFKC box, headed 18 characters, holding first floor, 54 m2, with Copy and Download above it.
    The NFKC box, headed 18 characters, holding first floor, 54 m2, with Copy and Download above it.

If NFKC changes more than you want

You only need accented letters spelled one way, with ² left raised

Unicode NFC Normalizer

NFC joins accents to their letters and leaves styled forms alone: it gives the PDF line back exactly as it went in.

You want to know which characters NFKC would change before you run it

Unicode inspector

With To on Code points, every character gets a row with its number, so the fl shows up as U+FB02 where a plain f and l would be two rows.

Search FluffyBench