Skip to main content

Fix Formatting

Fix Weird Spacing When Pasting Text

By Issaaf Kattan · Updated

Paste your text to clean it

Your text

No text handy? Try:

Cleaned text

Your text never leaves this browser. How we know

Same words · No AI rewriting · No content logging

Why does my text paste with weird gaps and irregular spacing?

"Weird spacing" is usually caused by three hidden factors: non-breaking spaces (NBSP), irregular newline characters, and trailing whitespace. When you copy text from a website, the browser's layout engine often includes these special characters to maintain the "look" of the page — but they fall apart when pasted into a standard editor.

The NBSP gap

Websites use U+00A0 (NBSP) to prevent line breaks. These don't behave like normal spaces in Notion or Docs, often causing huge, un-deletable gaps at the ends of lines.

Newline chaos

Windows (CRLF), classic Mac (CR), and Linux (LF) all encode "Enter" differently. Mixing them produces double or triple spacing you didn't ask for.

Trailing bloat

Invisible spaces at the end of a line can push text over the margin, causing "ghost" line breaks that make paragraphs look jagged.

How to fix text that won't wrap correctly

Our spacing fixer doesn't just find-and-replace — it normalizes. It converts every common non-standard space to the standard ASCII space (U+0020) — U+00A0, U+202F, the U+2000 to U+200A range, U+205F, and U+3000, each enumerated in the character reference — collapses excessive blank lines while preserving paragraph structure, and trims every line to its last visible character. If non-breaking spaces are your main problem, the next section explains that character in depth.

This ensures your text wraps naturally according to the margins of the destination editor — whether that's a Notion block, a Slack message, or a Google Doc. For every other kind of paste damage (invisible characters, typography, encoding), the main text cleaner handles the full sweep in one pass.

NBSP vs. standard space: what's the difference?

A non-breaking space (NBSP, U+00A0) looks exactly like a normal space (U+0020) but behaves like a letter: it forbids an automatic line break at its position. That's useful for keeping pairs like "10 kg" or "page 7" together, but websites write it as the   entity and use it liberally for layout. When a whole paragraph is full of them, there are no breaking spaces left, so the editor treats it as one giant "word" and pushes the entire block to a new line or creates a horizontal scrollbar.

The NBSP has cousins. The narrow no-break space (U+202F) is a thinner version used in French typography, and the word joiner (U+2060) is a zero-width no-break character; both are converted or removed by the cleaner. To spot NBSPs in Microsoft Word, turn on formatting marks (Ctrl+Shift+8): regular spaces show as dots and non-breaking spaces as small degree-like circles. Google Docs has no equivalent view, so pasting the text into a checker that counts U+00A0 occurrences is the fastest diagnosis.

When TRIM doesn't work in Excel

Excel's TRIM only removes the ordinary space (character 32), so a non-breaking space (character 160) survives it and makes VLOOKUP, MATCH and equality tests fail: a lookup for "Acme Inc" will not match "Acme" + non-breaking space + "Inc". CLEAN doesn't help either — it only removes the ASCII control characters with codes 0 to 31. Nest the replacements, then trim:

=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1, UNICHAR(160), " "), UNICHAR(8239), " "), UNICHAR(8203), ""))

That converts non-breaking spaces (160) and narrow no-break spaces (8239) to normal spaces and deletes zero-width spaces (8203). Fill it down a helper column, copy the results, and Paste Special as Values over the original. UNICHAR is available in Excel 2013 and later. To find which hidden character is in a cell, =UNICODE(MID(A1, n, 1)) returns its code for position n.

Does AI-generated text have spacing problems too?

Less than you might expect. In our November 2026 copy test, text copied straight from ChatGPT had no special spaces. AI drafts usually pick up non-breaking spaces (U+00A0), which look identical to regular spaces yet wrap and search differently, once they pass through Word, a PDF or email. Narrow no-break spaces (U+202F) also appeared briefly in ChatGPT output, and the cleaner converts both to ordinary spaces regardless of where they came from. If you're moving AI drafts into documents, the AI text cleaner handles spacing and typography in one pass — or see the guide to pasting AI text into Word and Google Docs.

Common questions

Frequently asked questions

Why does my text have weird spacing when I paste it?

Copied text carries hidden characters the source used for layout: non-breaking spaces (U+00A0) that forbid line wrapping, narrow no-break spaces (U+202F), mixed newline conventions from Windows and Unix, and trailing whitespace at line ends. Your destination editor interprets them differently than the source did, producing gaps, jagged paragraphs, and lines that refuse to wrap.

How do I remove weird spaces from text?

Paste the text into a whitespace normalizer like CleanPastedText. It converts every common non-standard space — non-breaking (U+00A0), narrow no-break (U+202F), the U+2000 to U+200A range, medium mathematical (U+205F), and ideographic (U+3000) — into the standard U+0020 space, trims trailing whitespace, and collapses excessive blank lines while preserving paragraph structure. The 'What changed' report shows exactly how many were fixed.

Why can't I delete a gap in my document?

The 'un-deletable' gap is usually a non-breaking space or a cluster of them. Because an NBSP glues the words around it into one unbreakable unit, the layout engine pushes the whole block around, and deleting one visible space doesn't remove its invisible neighbors. Converting all NBSPs to normal spaces removes the gap at the source.

Why does pasted text get double line breaks?

Windows encodes 'Enter' as CRLF (U+000D followed by U+000A) while Mac and Linux use LF alone. When conventions mix — or when an editor converts HTML paragraphs into blank-line-separated text — you get doubled or tripled spacing you never typed. Normalizing every line ending to a single LF fixes it.

Does AI-generated text cause weird spacing?

Sometimes. In our November 2026 copy test, text copied straight from ChatGPT had no special spaces; AI drafts usually pick up non-breaking spaces (U+00A0) once they pass through Word, PDFs or email. Narrow no-break spaces (U+202F) also appeared briefly in o3 and o4-mini output in April 2025. Cleaning AI text before pasting it into Word, Docs, or Notion prevents the spacing glitches entirely.

What is the formula to remove non-breaking spaces in Excel?

Use =TRIM(SUBSTITUTE(A1, UNICHAR(160), " ")). SUBSTITUTE swaps each character 160 for a normal space and TRIM then tidies leading, trailing and repeated spaces. In older versions without UNICHAR, CHAR(160) works for the same character on Windows.

Continue reading

Related guides & tools