Home Text Tools Math & Numbers Developer Tools Date & Time Image Tools Blog
Remove Hidden Characters

Fix Weird Spacing in Text Copied From PDFs and Word

Strip zero-width spaces, non-breaking spaces and other invisible characters that cause odd line breaks when you paste into a CMS or website.

You paste a paragraph from a PDF into your website editor and the line breaks in strange places, words refuse to wrap or a search for a phrase finds nothing. The cause is often invisible characters hiding in the text. Removing them takes one pass.

Remove Hidden Characters FREE online toolRuns in your browser. No sign-up, nothing to install. Open the tool

Which characters hide in copied text

Several invisible characters turn up in copied text. The zero-width space (U+200B) has no width but can allow or force a break. The non-breaking space (U+00A0) looks like a space but prevents wrapping and fails normal space searches. The soft hyphen (U+00AD) appears only at line ends in some layouts, and byte order marks (U+FEFF) sometimes sit at the start of a file.

Step by step

  1. Copy the troublesome text from the PDF or Word file.
  2. Paste it into the Remove Hidden Characters tool.
  3. Run the cleanup and copy the cleaned text.
  4. Paste into your website or CMS using a plain text option if available.
  5. Spot check a few places where you saw problems before publishing.

Symptoms that point to hidden characters

  • A long line of text that overflows its container instead of wrapping.
  • A phrase that looks identical to another but does not match when you search.
  • Extra gaps between words even though you only typed one space.
  • Sentences broken mid-line, left over from the PDF's hard line breaks.
  • Database or spreadsheet values that fail to match, such as two names that look the same.

Why PDFs are especially messy

PDFs store text as positioned fragments rather than flowing paragraphs. When you copy, many viewers insert a line break at the end of every visual line and hyphenate words at the edge. You may need to join lines back into paragraphs after cleaning the invisible characters. Word documents add their own, such as non-breaking spaces before punctuation, tabs and special quotes.

Keep what you need

Not every special space is wrong. A non-breaking space between a number and its unit, such as 10 kg, keeps them together on one line. And languages like Persian, Arabic or Hindi use zero-width joiners and non-joiners to shape letters properly. Removing those from text in those languages can break the writing, so keep the original and compare the result if your content includes them. The tool also deletes non-breaking spaces outright instead of turning them into normal spaces, so check that words were not joined together.

Emoji sequences also use zero-width joiners to combine symbols, so cleaning may split a family or flag emoji into separate parts.

Checking the result

After cleaning, read the message that says how many hidden characters were removed. A few removed from a long paragraph confirms that invisible characters were present. If the count did not change but the problem remains, the cause might be formatting rather than characters, such as styles carried over from Word, which plain-text pasting will fix.

Prevent it next time

Paste as plain text into your editor, using the keyboard shortcut Ctrl+Shift+V or Cmd+Shift+V, which drops most formatting. Clean important copy before importing in bulk, since invisible characters in titles and URLs can break links and slugs.

Try the free Remove Hidden Characters
Runs in your browser. No sign-up, nothing to install.

Comments (0)

No comments yet. Be the first to share a thought.