Skip to content

Text cleaner

Paste messy text, choose what to fix, and press Clean text. Each option shows how many places it will change.

0 characters, 0 lines Paste text to see what needs cleaning.
My text comes from
Spaces
Line breaks

To remove every line break, or to keep only the paragraphs, use remove line breaks.

Characters
Formatting
Advertisement
A crumpled page of text next to a smooth clean page, with a small broom sweeping loose marks away

Where messy text comes from

Most mess comes from copying. Each program stores text its own way, and the copy brings those habits along. Pick the source under "My text comes from" and the tool turns on the right options.

Copied fromWhat goes wrongOption that fixes it
PDF filesA line break at the end of every line, words split with a hyphen, ligatures like "fi" as one characterJoin lines broken in a sentence, Rejoin words, Fancy letters and ligatures
Word and emailNo-break spaces, soft hyphens, ">" marks in replies, extra empty linesOdd spaces, Hidden characters, Email quote marks, Empty lines
Web pagesTabs and runs of spaces from the page layout, zero width spaces, HTML codes like &Repeated spaces, Tabs, Hidden characters, Remove HTML tags
Chat apps and social postsBold or script letters from font generators, zero width joiners, direction marksFancy letters, Hidden characters
SpreadsheetsTabs between cells, spaces at the end of cellsTabs, Remove spaces at line ends

How to fix line breaks in text from a PDF

A PDF does not store paragraphs. It stores each line of text at a spot on the page. When you copy, every line ends with a line break, even in the middle of a sentence.

"Join lines broken in a sentence" puts the lines back together. It keeps a break after an empty line, before a list item, before an indented line, and after a short line that ends with a period. A word split with a hyphen at the end of a line ("exam-" and "ple") is put back together when the next line starts with a small letter. The tool guesses from line lengths, so read the result once before you use it.

Hidden characters you cannot see

Some characters take up no space at all. A zero width space tells a browser where a long word may wrap. A zero width joiner glues emoji together, so 👨‍👩‍👧 shows as one family emoji. Copied into a name, a password or a spreadsheet, they break searches and matches. "hello" with a zero width space inside looks the same but is not found by a search for "hello".

CharacterCode pointWhere it comes fromRemoved?
Zero width spaceU+200BWeb pages, chat apps, some CMS editorsYes
Zero width joinerU+200DEmoji sequences, Indian scriptsOnly outside emoji and words
Zero width non-joinerU+200CPersian, Hindi and other scriptsOnly outside words
Byte order markU+FEFFThe start of files saved by older Windows toolsYes
Soft hyphenU+00ADWord and web pages, marks where a word may breakYes
Word joinerU+2060Typesetting, keeps two parts on one lineYes
Right to left overrideU+202ETricks that flip text, like a file name that hides its real endingYes
Left and right marksU+200E, U+200FArabic and Hebrew textKept when the text has Arabic or Hebrew letters
Variation selectorsU+FE00 to U+FE0FEmoji style, like the red heart ❤️One right after a character stays. A long run of them can hide data, so it goes.

To see each hidden character by name before you remove it, paste your text into the hidden character finder.

Spaces that are not normal spaces

Unicode has more than a dozen spaces. Word puts a no-break space (U+00A0) where you press Ctrl+Shift+Space, and web pages write it as  . It looks like a normal space, so a search for two words with a normal space between them misses it. Some programs also write a narrow no-break space (U+202F) between the time and "PM".

"Odd spaces to normal spaces" turns all of them into the space from your keyboard (U+0020). Turn it off for French text, where a no-break space before "!" and "?" is part of the spelling.

Advertisement

Curly quotes, dashes and fancy letters

Word and phones change straight quotes into curly ones as you type. In code, a CSV file or a command, a curly quote is a different character and causes errors. The dash option changes long dashes and the minus sign into the keyboard hyphen, and the ellipsis character into three dots.

Fancy letters from font generators are math symbols, like the bold 𝐀 (U+1D400). The tool turns them back into plain letters with Unicode NFKC, the same rule that splits the "fi" ligature into "f" and "i". Signs like ™, ½ and ² stay as they are. To make fancy letters on purpose, use the font converter.

Line endings: Windows, Mac and Linux

A line break is one or two hidden characters. Windows uses two, a carriage return and a line feed (CRLF). Mac and Linux use only the line feed (LF). Most programs read both, but some older Windows tools show an LF file on one line. Pick "CRLF (Windows)" under Line endings, and the copy and the download use two characters per break.

Frequently asked questions

How do I remove line breaks from text copied from a PDF?

Paste the text, press "Text from a PDF" and then Clean text. Lines broken in the middle of a sentence are joined, and paragraphs stay apart. Check Preview changes first if the text has lists or tables.

How do I find hidden characters in my text?

Paste the text and press Show hidden characters. Each hidden character shows as a small label, like ZWSP for a zero width space, with its code point when you point at it.

Why does my text look the same after cleaning?

Most changes are to characters you cannot see, like double spaces, no-break spaces and zero width spaces. Press Preview changes before you clean to see each one marked in color.

Will the cleaner change my words?

No. Letters, digits and punctuation stay, and emoji stay whole. Fancy letters, curly quotes and dashes change only when their option is on. If you do not like the result, press Undo.

How do I remove all line breaks and make one paragraph?

Use remove line breaks and pick One line. You can also keep the empty lines between paragraphs, or put a comma in place of each break.

How do I remove duplicate lines?

Paste your list into remove duplicate lines. It keeps the original order and can ignore case and extra spaces.

  • Text editorWrite and edit text online for free, then convert it to fancy fonts, bold, frames and ASCII art in one click.
  • Invisible characterCopy an invisible character or blank space for empty names and messages.
  • Word counterCount words, sentences and paragraphs as you type.
  • Text comparePaste two texts and see every changed line and word highlighted side by side.
  • NotepadKeep several notes in one place.
  • PDF to textGet the text out of a PDF file.

↑ ↓ to choose, Enter to open, Esc to close