Guide · Updated 2 November 2026

Why copied text breaks formatting

Text that looks perfect can still fail a search, a formula or a password. The cause is almost always a character you can't see.

Short answer

Copied text often carries invisible or look-alike characters, such as zero-width spaces, non-breaking spaces, curly quotes and byte order marks. They look normal on screen but software treats them as different characters, which breaks searches, formulas, code and passwords. Pasting the text into a cleaner removes them.

The usual suspects

What you see What's really there What it breaks
A normal space Non-breaking space (U+00A0) Searches, Excel numbers, CSV files
Nothing at all Zero-width space (U+200B) Passwords, searches, word counts, code
Nothing at the start Byte order mark (U+FEFF) First column of a CSV, scripts
A quote mark Curly quote “ ” instead of " Code, formulas, command lines
A hyphen En or em dash – — Command-line options, IDs, phone numbers
A Latin letter Look-alike Cyrillic letter Searches, logins, domain names

Where they come from

  • Web pages use non-breaking spaces to keep things together and zero-width spaces to let long words wrap.
  • Word and Google Docs turn straight quotes into curly ones and double hyphens into dashes as you type.
  • PDFs often scatter spaces and joiners between letters when you copy from them.
  • Chat and AI apps format their answers for display, and some of that formatting comes along when you copy.
  • Spreadsheets and CSV exports sometimes start with a byte order mark.

How to fix it

  1. For one-off text: paste it into the invisible character checker, look at what lights up, and copy the clean version. Look-alike letters from other alphabets aren't flagged yet.
  2. For plain pasting: use paste without formatting (Ctrl+Shift+V on Windows, Cmd+Shift+Option+V on a Mac). This drops fonts and colours, but not invisible characters.
  3. In Excel: =CLEAN(SUBSTITUTE(A1, CHAR(160), " ")) handles the most common cases. CLEAN removes control characters but not zero-width spaces.
  4. In code editors: turn on the option that shows invisible or control characters, and search for the code point, for example ​.

Prevention

Type short things like passwords and IDs by hand rather than copying them. When you build forms or import scripts, strip zero-width and non-breaking characters on input. Most hard-to-explain it looks right but doesn't work problems disappear.

Questions

Why does my pasted password not work?

The copied password probably contains a zero-width space or a non-breaking space, often at the start or end. It looks identical but isn't the same text. Paste it into a cleaner, or type it by hand.

Why does Excel say my numbers are text?

Numbers copied from web pages often contain non-breaking spaces as thousand separators. Excel can't read 1 250 as a number. Replace CHAR(160) with nothing, or clean the text first.

How do I paste without formatting?

Use Ctrl+Shift+V on Windows and ChromeOS, or Cmd+Shift+Option+V on a Mac (Cmd+Shift+V in Chrome and Google Docs). That removes fonts and colours, but not invisible characters. Those need a cleaner.

Can invisible characters break code?

Yes. A zero-width space or a curly quote inside code causes errors that are hard to spot, because the line looks correct.