TextJanitor

Remove Line Breaks

Paste text from a PDF, email or web page and clean up broken lines, extra spaces and invisible characters in one click.

Presets

Replace line breaks with

Working…

Your text is processed in your browser and is never uploaded or stored on our servers.

How to use the Remove Line Breaks

  1. 1 Paste your text into the top box.
  2. 2 Pick a preset, or choose your own options below the box. The cleaned text appears underneath straight away.
  3. 3 Check how many characters were removed, and adjust the options if the result is not quite right.
  4. 4 Copy the cleaned text or download it as a .txt file.

Why copied text looks broken

Text copied from a PDF usually keeps the line breaks of the printed page, so every line ends where the page ended, not where the sentence ends. Emails are wrapped at a fixed width, and web pages often carry non-breaking spaces and other characters you cannot see. Paste any of that into a document, a spreadsheet or a form and you get ragged lines, double spaces and words that refuse to match when you search.

Before

The quick brown fox jumped over the lazy dog and kept run- ning until it reached the river bank.

After

The quick brown fox jumped over the lazy dog and kept running until it reached the river bank.

Invisible characters

This is the part most line break removers skip. The cleaner can strip zero-width spaces, byte order marks, soft hyphens and left-to-right or right-to-left direction marks. These characters take no visible space, yet they break searches, make two identical-looking words differ and can corrupt code, file names and spreadsheet cells. Non-breaking spaces are turned into normal spaces. Joiner characters used inside emoji and in some scripts are left alone so those still display correctly.

What each option does

  • Replace line breaks with a space, nothing, or text of your own, such as a comma.
  • Keep paragraph breaks, so blank lines between paragraphs survive while the lines inside them are joined.
  • Collapse repeated spaces and tabs, trim each line, or remove empty lines and every space.
  • Rejoin words that were hyphenated across lines, which is how many PDFs split long words.
  • Straighten curly quotes and dashes when you need plain characters.

Presets and a warning

The presets save time. Fix text copied from a PDF joins the lines, keeps paragraphs and rejoins split words. Single line puts everything on one line. Clean email text unwraps the lines and straightens quotes. Rejoining hyphenated words looks for a hyphen at the end of a line followed by a lowercase letter, so a real compound such as well-known that happened to break there loses its hyphen too. Skim the result for those.

When you are done, the case converter can fix capitalization, and the word counter will tell you how long the cleaned text is.

Frequently asked questions

Will it remove the blank lines between my paragraphs?

Not by default. "Keep paragraph breaks" is on, so blank lines between paragraphs stay and only the line breaks inside each paragraph are joined. Turn it off to get one single block of text.

What are invisible characters and why remove them?

They are characters such as zero-width spaces and soft hyphens that take up no visible room. They can make searches fail, break copied code and cause stray gaps in spreadsheets, so removing them is usually safe and helpful.

How does it fix words split across lines in a PDF?

With the rejoin option on, a hyphen at the end of a line followed by a lowercase letter on the next line is removed and the two parts are joined, so inter- and national become international.

Can I replace line breaks with a comma?

Yes. Choose "Custom text" and type a comma and a space. Each line break then becomes that text, which is handy for turning a list into one comma-separated line.

Does it work on Windows and Mac line endings?

Yes. Windows, Mac and Linux line endings are all treated the same way before cleaning.

Is my text sent to a server?

No. The cleaning runs in your browser and your text never leaves your device.