Clean pasted text (code-safe)

Fix copy/paste breakers that make JSON, CLI commands, API keys, and copied code fail: remove invisible Unicode characters (zero-width/bidi/joiners), convert smart quotes, and normalize weird spaces and dashes — with a transparent report.

changed
input chars
output chars
line endings (as received by browser)

Tool

Preset:
Input
Output (raw)
Diagnostic preview
Markers: · space, ⍽ weird space, [ZW] invisible, [BIDI] directional, → tab
Input preview

                
Output preview

                
Advanced rules
Tip: In normal use, rely on presets. Advanced is for edge cases.
Workflow: use Audit only to scan first (no changes), then Apply fixes to generate cleaned output you can safely copy.

What was found / fixed

This report is the point: it shows exactly what was detected (and what was changed, if you apply fixes).

Why copy/paste breaks code

  • Smart quotes ( “ ” ‘ ’ ) look like quotes, but JSON/code expects " or '.
  • Weird spaces (NBSP, thin spaces, ideographic spaces) look normal but break parsing, trimming, or string equality.
  • Zero-width & joiners are invisible and can corrupt tokens, URLs, and identifiers.
  • Bidi/directional marks can make text look identical while the underlying bytes differ.

Clean pasted text for code, JSON, and CLI commands

If you’ve ever pasted a command and the terminal says “unknown option”, or your JSON parser throws an error even though the text “looks fine”, the cause is often hidden Unicode characters. This page helps you remove zero-width characters, convert smart quotes to straight quotes, and normalize non-breaking spaces so copied text becomes safe for code and configuration.

Common situations this tool fixes

How to use it

Start with Audit only to scan without changes. If the report shows suspicious characters (like [ZW] or [BIDI]), click Apply fixes and then Copy cleaned. For JSON, use JSON safe and press Try parse JSON.

What “weird spaces” means

Weird spaces include non-breaking space (NBSP), thin spaces, em/en spaces, and ideographic space. They can look like a normal space but behave differently. In code, configuration, and tokens, these characters can cause hard-to-debug errors.

FAQ

Does Audit only change my text?
No. Audit only scans the input and shows markers + a report. Use “Apply fixes” to generate cleaned output.
Why does the tool sometimes report LF line endings even if I copied from Windows?
Browsers often normalize line endings on paste before JavaScript receives the text. That’s why line-ending conversion is in Advanced and verified by tests.
Will this reformat or minify my code?
No. It only targets common copy/paste breakers (quotes, weird spaces, invisibles, dashes). It does not reindent, minify, or rewrite syntax.
What should I do if nothing changes but my code still fails?
Use “Detect tabs” and “Detect trailing spaces”, and for JSON use “Try parse JSON”. If those pass, the issue is likely not copy/paste characters.

Related tools & guides

Useful one-page tools and guides from ClearExplained — built to prevent costly mistakes in subscriptions and payments.

Subscription reminder
Set a simple reminder flow so renewals don’t surprise you.
Subscription reality check
Quick sanity-check before you keep paying for something you don’t use.
Monthly vs yearly break-even
See when annual plans actually save money — and when they don’t.
More tools will be added over time — this section keeps related workflows one click away.

References & further reading

Authoritative sources about Unicode characters that commonly break copy/paste in code and configuration.

Tip: if a link opens in a new tab, it uses rel="noopener noreferrer" to prevent tab-nabbing.

ClearExplained — simple pages that reduce mistakes.