← Back to Blog

Workflows & Productivity | Published Aug 21, 2026 | Updated Oct 13, 2026 | 6 min read

How to Remove Hidden Characters From Copied Text

By Khushi Yadav

How to Remove Hidden Characters From Copied Text — Edge Drop Guide

Copied text, especially from web pages and PDFs, often contains characters you can't see: soft hyphens (U+00AD), zero-width spaces (U+200B), non-breaking spaces (U+00A0) and byte order marks (U+FEFF). Pasting as plain text doesn't remove them, because they're characters, not formatting. Delete them with Word's Find and Replace (Special menu), a regular-expression replace in an editor such as VS Code, or a short PowerShell command that cleans the clipboard before you paste.

The hidden characters you'll usually find

CharacterCode pointWhere it comes fromWhat goes wrong
Soft hyphenU+00ADWeb pages and PDFs that hyphenate long wordsSearch misses the word; stray hyphens appear in some apps
Zero-width spaceU+200BWeb layouts that allow line breaks inside long stringsWords look normal but don't match in search; code and IDs break
Word joinerU+2060Exported or generated textInvisible character before or inside words
Byte order markU+FEFFText from files saved with a BOMInvisible character at the start of the text breaks the first value
Non-breaking spaceU+00A0"10 MB", names and prices on web pagesLines won't wrap; formulas and scripts don't treat it as a normal space

Two related characters, the zero-width joiner (U+200D) and zero-width non-joiner (U+200C), also look invisible, but don't remove them blindly. They hold emoji sequences together and are needed in scripts such as Persian and Arabic.

How to tell hidden characters are there

  • Search fails for a word you can see on screen.
  • The cursor sticks: you press the right arrow and it doesn't move, because it stepped over an invisible character.
  • Word or character counts are higher than they should be.
  • A pasted command or value fails even though it looks identical to one that works.
  • In Word, press Ctrl+Shift+8 to show nonprinting characters. A non-breaking space shows as a small degree-like symbol.

Remove them in Word

  1. Press Ctrl+H to open Replace.
  2. Select More, click in Find what, then select Special.
  3. Choose Optional Hyphen (Word enters ^-) to find soft hyphens. Leave Replace with empty.
  4. Select Replace All.
  5. Repeat with Special > Nonbreaking Space (^s), and type a normal space in Replace with.

Run the replacements on a copy of the document first, or be ready to press Ctrl+Z. Keep non-breaking spaces where you want them, such as between a number and its unit.

Word's Special menu doesn't list zero-width spaces. For those, use one of the methods below.

Remove them in VS Code or another regex editor

  1. Paste the text into a new file in VS Code.
  2. Press Ctrl+H to open Replace, then Alt+R to turn on regular expressions.
  3. In the find box, enter [\u00AD\u200B\u2060\uFEFF] and leave the replace box empty.
  4. Select Replace All.
  5. To swap non-breaking spaces for normal ones, find   and replace with a single space.

Notepad++ and most other code editors can do the same with their regex search. Regex vs clipboard tools for cleaning pasted text covers more patterns.

Clean the clipboard itself with PowerShell

This removes the characters from whatever text is on the clipboard, so your next Ctrl+V pastes the clean version. It works in Windows PowerShell 5.1 and PowerShell 7:

$text = Get-Clipboard -Raw
$text = $text -replace '[\u00AD\u200B\u2060\uFEFF]', ''
$text = $text -replace ' ', ' '
Set-Clipboard -Value $text

The first replacement deletes soft hyphens, zero-width spaces, word joiners and byte order marks. The second turns non-breaking spaces into normal spaces; leave that line out if you want to keep them. The -Raw switch keeps line breaks intact. The PowerShell clipboard cheat sheet has more commands like this.

Plain-text paste isn't enough on its own

Ctrl+Shift+V and Word's Keep Text Only remove fonts, colours and links, not characters. Paste as plain text first (how to paste without formatting), then remove hidden characters with one of the methods above.

Other text problems need their own fix:

FAQ

Does Notepad show hidden characters?

Not reliably. Notepad has no option to display invisible characters, so they're easy to miss there. Use Word's formatting marks or a code editor instead.

Why would a website add zero-width spaces?

Usually to let long strings, such as URLs or product codes, wrap at narrow screen widths. The character stays in the text when you copy it.

Is it safe to remove every non-ASCII character instead?

No. That also deletes accented letters, curly quotes, currency symbols and emoji. Target the specific invisible characters listed above.

Related reading

Sources

Khushi Yadav
Written by Khushi Yadav · Author & Content Writer

Khushi Yadav writes Edge Drop's workflow and design guides and is a B.Tech Computer Science Engineering student. Khushi's posts are checked against Microsoft's documentation and the Edge Drop fact sheet.

GitHub · LinkedIn

Copy. Stack. Drop.

Transform your clipboard into an interactive edge shelf. Stack, pin, and drag assets into any app with zero friction.

Download for Windows Get from Microsoft Store

How to Install Guide · First 10 Minutes Guide · Drag & Drop Guide · Edge Drop vs Win+V · Support

Free · Lightweight · Privacy First
Find us on CodeHype