How to use the Clean Up Text Formatting
- 1 Paste the text with “Paste text”, or drop a .txt or .md file.
- 2 Check the cleaning options. For text from a PDF, keep “Join lines that were wrapped inside a paragraph” on.
- 3 Compare before and after in the preview.
- 4 Copy the result or download it as a text file.
The usual mess
Text copied out of a PDF has a line break at the end of every printed line, and words broken with a hyphen. Text from a web page carries non-breaking spaces and zero-width characters that look like nothing and break searches and comparisons. Text typed by hand has two spaces after every full stop.
What each option does
- Trim and collapse: removes spaces at the start and end of lines and replaces runs of spaces by one. Indentation can be kept.
- Join wrapped lines: inside a paragraph (blocks separated by a blank line) lines are joined with a space. Bullet and numbered items start a new block. “Repair hyphenated words” also joins
inter-+nationalintointernational, but only when the next line starts in lowercase. - Blank lines: keep them, keep one between paragraphs, or remove them all.
- Invisible characters: removes zero-width spaces, soft hyphens and control characters, and turns non-breaking spaces into normal ones.
- Curly quotes, dashes and ellipses can be straightened for systems that mishandle them.
- Tabs and line endings: replace tabs with spaces and choose LF or CRLF.
Limits
Joining lines is a heuristic: a poem or an address block is also “wrapped lines”, so check the preview or turn the option off. Hyphen repair cannot tell a word split by the layout from a real compound that ends a line, such as well- / known; it joins only when the next line starts in lowercase. If you only want to delete blank lines, there is a dedicated page.
Frequently asked questions
Why are hidden characters a problem?
A zero-width space or a non-breaking space looks like normal text, but it makes two equal strings differ, so searches, comparisons and imports fail.
Will it join lines that should stay separate?
It joins lines inside a paragraph. Blank lines and list items mark where a block ends. Turn the option off for poems or address lists.
Is my text uploaded?
No. It is processed in your browser.
Last updated: