LLM Text Cleaner: Remove Invisible Characters – Free

This LLM text cleaner strips zero-width characters, trailing whitespace and surplus blank lines from model output, and normalizes line endings and Unicode composition. Cleaning happens in your browser.

How to use the LLM text cleaner tool

  1. Paste the model output or any copied text into the Text box, or select Example to load a sample with stray spacing.
  2. Select Clean text to apply all cleanup rules at once.
  3. Review the cleaned text in the Result box. Visible wording and punctuation are not changed.
  4. Select Copy and paste the result into your editor, CMS or commit message.

What the LLM text cleaner changes, in order

There are no options. Each run applies the same six operations in this sequence.

  • Unicode is normalized to NFC, so a letter followed by a combining accent becomes the single precomposed character.
  • Windows CRLF, old Mac CR and the U+2028 line separator all become a plain line feed.
  • Three invisible characters are deleted everywhere: zero width space U+200B, word joiner U+2060 and the byte order mark U+FEFF.
  • Spaces, tabs, non-breaking spaces and other Unicode whitespace at the end of each line are removed.
  • Runs of three or more line breaks shrink to two, leaving at most one blank line between paragraphs.
  • Whitespace at the very start and end of the whole text is trimmed.

A before and after example

In the sample below, the first line ends with a zero width space and two spaces, four CRLF line breaks follow, the bullet lines end with a non-breaking space and a tab, and the last line holds only a byte order mark. The input is written with escapes so you can see the hidden characters.

Before (escaped):
Summary:\u200B  \r\n\r\n\r\n\r\n- First point\u00A0\r\n- Second point\t\r\n\uFEFF

After:
Summary:

- First point
- Second point

Why invisible characters cause real bugs

Text copied from chat interfaces, web pages and PDFs can carry characters that render as nothing. A zero width space inside an identifier makes two strings that look identical compare as different. A byte order mark at the top of a file can break a shebang line, a JSON parser or a CSV header. Trailing whitespace creates noisy diffs.

Unicode composition is a quieter problem. The letter é can be one code point or an e plus a combining acute accent. Both display the same, but they differ in length and do not match each other in a plain string search. NFC, defined in Unicode Standard Annex 15, picks the composed form, which is the form most keyboards and web content already produce.

What the cleaner deliberately keeps

The tool is conservative. It does not rewrite curly quotes, long dashes or ellipsis characters, does not strip Markdown symbols, and does not collapse double spaces inside a line. Indentation at the start of lines is preserved, except on the very first line, where the final trim removes it.

The zero width joiner U+200D and non-joiner U+200C stay in place because emoji sequences and scripts such as Persian and Hindi depend on them. Soft hyphens and bidirectional marks are also left alone. One side effect to know: Markdown uses two trailing spaces for a hard line break, and those are removed along with other trailing whitespace.

Frequently asked questions

Does this remove AI watermarks from text?

It removes three specific invisible characters and trailing whitespace, which some people describe as watermarks. It does not change wording, punctuation style or anything statistical about the text, so it has no effect on detectors that analyze the writing itself.

Which invisible characters are removed?

Zero width space (U+200B), word joiner (U+2060) and the byte order mark, also called zero width no-break space (U+FEFF). Other format characters, including the zero width joiner, non-joiner and soft hyphen, are kept.

Does cleaning break code blocks or indentation?

Leading indentation is kept on every line except the first, so nested code and lists survive. Only whitespace at line ends is cut, and runs of several blank lines are shortened to one, which can matter for formats that rely on two blank lines.

Is the text I paste stored anywhere?

No. The cleanup is a chain of string replacements executed by the page's JavaScript. The text is not transmitted or saved.

What is NFC normalization?

NFC is the Unicode normalization form that composes characters. A base letter plus a combining mark is replaced by the equivalent single code point where one exists, so strings that look identical also become identical code point sequences.

Related tools