The workshop · Clean up pasted text
How it works : Clean up pasted text
Pasted text carries what nobody can see: zero width characters, writing direction controls that flip the display without changing a single byte, spaces that are not spaces. The tool NAMES them one by one, with their official Unicode names, then strips them.
The visible mess of a copy and paste takes two minutes to fix: double spaces, extra blank lines, stray bullets. The INVISIBLE mess does not, and that is the expensive one. Text pasted from a web page or a document often carries characters that do not display at all, and which make a search, a comparison, a data import or a form fail without anyone understanding why.
This tool lists them BEFORE stripping them, each with its official Unicode name and its code point. Two families are worth knowing about. Zero width characters: a recognisable pattern of them can be hidden inside a text, and that pattern survives copy and paste. Bidirectional writing controls: they reorder the DISPLAY without changing the bytes, which lets a text read one way and execute another. That last technique was published in 2021 by two Cambridge researchers under the name Trojan Source.
The rest is honest convenience: Unicode normalisation to composed form, recommended for all content by Unicode annex 15 and by the W3C; non-breaking spaces brought back to ordinary spaces; typographic quotes converted if you ask; and the rejoining of words hyphenated at a line break, the classic trap of text copied out of a PDF.
How it works
- Paste your text. It does not leave your device.
- Read the table: it names every invisible character found, how many times, and what it does.
- Set what you want stripped, then copy the result. The boxes work live: the result is recomputed on every change.
Formats accepted
Text. If your clipboard also carries rich formatting, your browser does not pass it to a text area: what arrives here is already plain text, and that is exactly right.
Text, typed or pasted
Up to 200,000 characters. The result copies with one click.
Its limits
Compatibility normalisation is DESTRUCTIVE, and it is not ticked by default
It turns the “fi” ligature into two letters, the fraction “½” into “1/2”, superscripts into ordinary digits, and full width characters into ordinary ones. Sometimes that is exactly what you want before a comparison; sometimes it is a loss of information. The Unicode annex that defines it warns explicitly that it must not be applied blindly, and we follow that warning.
On variation selectors, we separate what is documented from what is merely observed
Unicode documents their intended use as an exceptional mechanism for difficult display cases, and the tool strips them on that basis. That arbitrary data can be hidden in them is a real technique, but we only found it described in a 2025 blog post whose own author calls it an abuse. So we present it as an observation, not as a fact established by a standards body: that is this site's rule.
The vulnerability identifiers for the Trojan Source attack are DISPUTED
Two identifiers were issued in 2021 for the bidirectional reordering technique. Both are marked as disputed in the public database: the Unicode consortium rejects the framing of “a flaw in its specification”, and its argument is not absurd, since these characters do exactly what they were designed to do. The research publication, on the other hand, is real and checkable. We give you both halves of the fact.
Rejoining words hyphenated at a line break is not ticked by default
It is very useful on text copied out of a PDF, where words are broken by the layout. But it cannot tell a broken word from a compound word that happens to fall at a line end. So the tool only rejoins between two lower case letters, which spares “Paris-Brest” and numbers, and it leaves the choice to you. Always reread afterwards.
Questions about this tool
Is my text sent anywhere?
No. Check it in thirty seconds: open the inspector with the F12 key, the “Network” tab, clear the list, then paste your text. Not one line appears. Cut your connection and do it again: the tool works the same, because the whole character catalogue it uses is written in the page.
What are these invisible characters actually for?
Mostly for legitimate things. The zero width joiner assembles a family emoji, the writing marks let Arabic and English mix in one sentence, the conditional hyphen shows where a word may be broken. The problem is not that they exist, it is that they travel with copied text while nobody sees them: they then break a search, a comparison or an import, and you hunt for an hour. And in a text received from someone else, they can also serve as an invisible watermark.
What is Trojan Source?
A technique published in 2021 by two researchers at the University of Cambridge. Bidirectional writing controls reorder the DISPLAY of a text without changing a single one of its bytes: a piece of code can therefore read as one thing and execute as another, including in a project's review tool. Two vulnerability identifiers were issued, both DISPUTED in the public database, because the Unicode consortium refuses to see a flaw in its specification. Both halves of the fact are true, and we give you both.
Should I tick compatibility normalisation?
Only if you know why. It is very useful before comparing two texts or importing data, because it reduces visual variants to the same character. But it is destructive: the “fi” ligature becomes two letters, the one half fraction becomes three signs, a superscript becomes an ordinary digit. The Unicode annex that defines it warns against applying it blindly. For a text meant to be read, leave plain composed form, which is ticked by default.
Why are my curly quotes not converted by default?
Because they are the right quotes for a text meant to be read. A word processor substitutes them automatically, and it is right to: in careful typography, in English as in French, those are the quotes. They only cause trouble in a technical context, a data file or code, where a curly quote is not a quote. So the box exists, unticked: it is up to you to know which world your text is going to live in.
Pasted text carries what nobody can see: zero width characters, writing direction controls that flip the display without changing a single byte, spaces that are not spaces. The tool NAMES them one by one, with their official Unicode names, then strips them.
VerifyThe proof, step by stepThe network inspector check, explained one gesture at a time, with screenshots.
The cornerThe text and data cornerCount, compare, format, clean. The small jobs that cost an hour when you do not have them at hand.