Text Cleaner - Remove Line Breaks and Extra Spaces

Tools / Text Tools / Text Cleaner

Text cleaner

Clean-up steps (the number shows how many changes each one made)
Characters before
—
Characters after
—
Lines before
—
Lines after
—

How to clean up text copied from a PDF

Text pasted from a PDF, an e-book or an old email often looks fine until you paste it somewhere else: a line break at the end of every printed line, words cut in half by a hyphen, double spaces, invisible characters that break search, and curly quotes that code and spreadsheets do not accept. This tool fixes all of that in one pass and shows how many changes each step made, so you can see what was wrong.

Three steps

  1. 1 Paste the messy text into the left box.
  2. 2 Leave the default steps on, or untick the ones you do not want. The number next to each step shows what it changed.
  3. 3 Read through the clean text on the right and copy it.

Why PDF text breaks at every line

A PDF does not store paragraphs, it stores lines placed at fixed positions on a page. When you copy, each printed line becomes its own line, so a paragraph turns into a stack of short lines. "Join broken lines" glues the lines of a paragraph back together, and "Keep paragraph breaks" treats a blank line as the end of a paragraph. If your PDF gave no blank lines between paragraphs, everything becomes one block: add an empty line where each paragraph should start, or untick "Keep paragraph breaks" to get one long line. While paragraph breaks are kept, lines that start with a bullet or a number (-, •, 1., a)) are treated as list items and stay on their own lines.

Words split by a hyphen

Justified text splits long words at the end of a line: "sen-" on one line, "tence" on the next. When a line ends with a letter and a hyphen and the next line starts with a small letter, the tool removes the hyphen and joins the halves into "sentence". The catch: a real compound that happened to break at its hyphen, such as "well-known", also becomes "wellknown". Scan the result for such words, or untick the option if your text has many of them.

Invisible characters

A non-breaking space looks like a normal space but is a different character, so searching for "copying text" will not find "copying" and "text" joined by one. Zero-width spaces, word joiners and byte order marks take up no room at all, yet they split words, break passwords and code, and make two identical-looking lines different. The tool turns non-breaking and thin spaces into normal spaces and deletes zero-width characters and soft hyphens. Zero-width joiners are kept on purpose: emoji sequences and scripts such as Hindi and Bengali need them. Invisible left-to-right and right-to-left marks are removed as well. PDFs also store letter pairs such as fi, fl and ffi as one ligature character (fi, fl, ffi): it looks right, but search and spell checkers do not recognise the word, so "Split ligatures" turns it back into ordinary letters.

Curly or straight quotes?

Word processors and PDFs turn " and ' into curly quotes. They look better in print, but code, JSON, CSV files, spreadsheet formulas and command lines only understand straight quotes. The tool converts single and double curly quotes, including the low „ ‚ forms, to straight ones. Guillemets « » and the prime marks ′ ″ used for feet, inches and minutes are left alone, because they are not curly versions of a straight quote.

Cleaning text: common questions

Paste the text and keep "Join broken lines" ticked. Lines inside a paragraph are joined with a single space, and words split by a hyphen at the end of a line are put back together. The result appears on the right straight away.
New
Online Notepad Write notes in your browser with no sign-up. Text is saved automatically on this device, never uploaded. Word and character count, .txt download.
Popular Today
Word Counter Free word counter: paste any text to count words, characters, sentences and paragraphs, and see the estimated reading time - nothing leaves your browser.

Other text tools

Word Counter Free word counter: paste any text to count words, characters, sentences and paragraphs, and see the estimated reading time - nothing leaves your browser.
Character Counter Free character counter: count characters with and without spaces, plus words and lines, and check SEO limits for titles and meta descriptions.
Lorem Ipsum Generator Free Lorem Ipsum generator: create placeholder text by paragraph, sentence or word count, with optional HTML tags for your design mockups.
Case Converter Free case converter: switch any text between lowercase, UPPERCASE, camelCase, PascalCase, snake_case, kebab-case and CONSTANT_CASE in one click.
Text Diff Compare two texts and see exactly what changed. Line or word level, side by side or inline, with neither text ever leaving your browser.

Other Tools You May Like

Word to PDF Convert Word to PDF for free: upload a DOC, DOCX, ODT or RTF file and download a properly formatted PDF in seconds - no registration or watermark.
PDF to Word Convert PDF to Word for free: upload a PDF and download an editable DOCX in seconds - no registration, no watermark and nothing to install.
MD5 Hash Generator Free MD5 hash generator: turn any text or file into an MD5 checksum in your browser - useful for integrity checks and quick fingerprinting.
Base64 Encoder & Decoder Free Base64 encoder and decoder: convert text or files to Base64 and back, entirely in your browser - nothing is uploaded to a server.
Keyword Density Checker Free keyword density checker: paste text or a URL to see how often each word and phrase appears, with percentages for one, two and three-word terms.