How to fix json broken by copy-paste
- Step 1Deal with smart quotes first — If the snippet came from Word, a docs page, Slack, or email, it likely has curly
“ ” ‘ ’quotes this fixer won't convert. Do a find-replace of“and”→"(and‘ ’→') in your editor first, or re-copy from a plain-text source. - Step 2Paste the snippet into the fixer — Paste the JSON, or save it to a
.txt/.jsonfile and drop it. Reading is local viafile.text(); nothing is uploaded. Smart quotes are invisible in many fonts, so don't assume the text is clean just because it looks right. - Step 3Pick an indent and click Fix JSON — Choose 2 or 4 spaces. The tool tries
JSON.parsefirst; if it throws, the five passes run and parsing is retried. - Step 4Read the Fixes applied list —
Replaced single quotes with double quotes,Removed trailing commas,Added quotes to unquoted object keys, orReplaced undefined with nullshow what paste damage was mechanically fixable. - Step 5If yellow, the damage is source-side — A yellow banner after fixing almost always means smart quotes, stripped backslashes, or em-dashes remain — none of which this tool fixes. Go back to step 1 and repair those in your editor, then re-run.
- Step 6Prevent the next round of corruption — When you share JSON through rich-text channels, wrap it in a code block (triple backticks in Slack/Teams/Markdown) so the platform preserves straight quotes and backslashes. Code blocks are the single best prevention.
Copy-paste corruption: fixable here vs source-side
What this fixer repairs versus the rich-text damage you must fix before pasting it in. The right column is the upstream action.
| Corruption | Fixed here? | Fix it where |
|---|---|---|
Straight single quotes ' ' | Yes — quote pass | n/a |
| Trailing comma | Yes | n/a |
| Unquoted keys | Yes | n/a |
Literal undefined | Yes (→ null) | n/a |
Curly smart quotes “ ” ‘ ’ | No | Find-replace to straight quotes in your editor first |
Stripped backslash escapes (\n, \") | No | Re-copy from a plain-text source; backslashes can't be inferred |
| Em-dash / en-dash for hyphen-minus | No | Replace —/– with - in your editor |
| Non-breaking spaces (CHAR 160) | No (not whitespace-normalized) | Find-replace NBSP → regular space |
Where paste corruption comes from
The usual source app and what it does to JSON. None of the smart-quote/dash transformations are reversible by this fixer.
| Source | What it does | Prevention |
|---|---|---|
| Microsoft Word / Google Docs | Auto-corrects " → “ ”, -- → em-dash | Paste into a code block or plain-text editor |
| Slack / Teams (plain message) | Smart-quote substitution outside code blocks | Wrap in triple backticks |
| Email (rich text) | Smart quotes; sometimes strips backslashes | Send as monospace/code, or attach a file |
| macOS system-wide | 'Use smart quotes and dashes' on by default | Disable in Settings → Keyboard → Text |
| Rendered docs / PDF | Typographic quotes baked into the page | Copy from the raw source, not the rendered view |
Cookbook
Real paste breakages. The first three are fully fixable here; the last two need a source-side step first.
Snippet from JS source: straight single quotes + trailing comma
ExampleCopied from a .js file via a plain-text editor, so quotes stayed straight. Two passes fully repair it.
Pasted:
{ 'env': 'prod', 'retries': 3, }
Fixes applied (2):
✓ Replaced single quotes with double quotes
✓ Removed trailing commas
Banner: Fixed & valid JSON
Output:
{
"env": "prod",
"retries": 3
}Object copied from a browser console with undefined
ExampleDevTools printed an object literal with unquoted keys and an undefined. Three passes fix it; the undefined pass is string-aware, so the word 'undefined' inside any string value is left untouched.
Pasted:
{ id: 7, name: 'a', deleted: undefined }
Fixes applied (... up to 3):
✓ Replaced single quotes with double quotes
✓ Added quotes to unquoted object keys
✓ Replaced undefined with null
Banner: Fixed & valid JSONTwo objects pasted on separate lines, comma lost
ExampleA messaging app reflowed the text and dropped the comma between objects. The missing-comma pass restores it.
Pasted:
[
{ "a": 1 }
{ "a": 2 }
]
Fixes applied (1):
✓ Added missing commas between elements
Banner: Fixed & valid JSONSmart quotes from Word — fix at the source first
ExamplePasted from a Word doc, the quotes are curly. This fixer won't convert them, so it reports invalid. Replace the curly quotes in your editor, then re-run.
Pasted (curly quotes — look normal, aren't):
{ “name”: “widget” }
Fixes applied (0)
Banner: Partially fixed — output may still have issues
Fix first (in your editor):
Find “ and ”, replace with "
Then re-run → valid.Stripped backslashes — unrecoverable here
ExampleEmail rich-text dropped the backslash from an escape sequence. The fixer can't infer where backslashes belonged, so it can't restore them. Re-copy from a plain-text source.
Pasted (backslash before n was stripped):
{ "path": "C:Users
ame" }
Fixes applied (0)
Banner: Partially fixed
Why: the original was "C:\\Users\\name". The fixer cannot
know which characters lost a preceding backslash.
Fix: re-copy the JSON from a code block / plain-text source.Errors and edge cases
Real errors and silent failures sourced from each platform's own documentation. Match the wording to the row, fix what the row says to fix.
Curly / smart quotes
InvalidThe most common copy-paste corruption and the one this fixer does NOT handle. Only straight ' quotes are converted; “ ” ‘ ’ survive and break parsing. They're invisible in many fonts, so the text looks fine. Find-replace the curly quotes to straight ones in your editor first, then run the fixer for the remaining issues.
Stripped backslash escapes
FailWhen a rich-text channel strips backslashes, "line\nbreak" becomes "linenbreak" and "a\"b" loses its escape. The fixer cannot infer where backslashes belonged, so this is unrecoverable here. Re-copy the JSON from a plain-text or code-block source where the backslashes survived.
Em-dash or en-dash replacing a hyphen-minus
InvalidWord and macOS turn - into —/– in some contexts. A negative number like -5 becoming —5 is invalid JSON, and the fixer doesn't normalize dashes. Replace —/– with - in your editor before fixing.
Non-breaking spaces (NBSP, CHAR 160)
InvalidPaste from rendered HTML can insert NBSP where a normal space was. The fixer doesn't normalize whitespace beyond what JSON.parse ignores, and NBSP is not JSON whitespace, so it can break parsing in odd spots. Find-replace NBSP → regular space in your editor.
undefined inside a string after paste is preserved
By designThe undefined pass is string-aware: it tracks string state while walking the snippet, so a string reading "value undefined" is left exactly as-is. Only a bare undefined value is rewritten to null. Pasted prose is never altered, so no review of string fields containing the word undefined is needed after fixing.
Apostrophe inside a single-quoted value
RejectA value like 'it's here' defeats the value-quote pass ('[^']*' stops at the inner apostrophe), producing broken output. This is common in prose pasted from a document. Switch those quotes to double quotes by hand.
Snippet was already valid
ExpectedIf the paste preserved everything (you copied from a code block or plain-text editor), the JSON parses on first try — No fixes needed — and you get it cleanly re-indented. The cleanest paste path: always copy JSON from a monospace/code context.
Mixed straight and curly quotes
InvalidPartial corruption — some quotes curly, some straight — happens when only part of the text passed through a rich-text app. The fixer converts the straight single quotes and leaves the curly ones, so the result is still invalid. Normalize all curly quotes first, then run the fixer.
Pasted text larger than 2 MB on free tier
BlockedFree tier caps at 2 MB. A paste that large is unusual; if you hit it, you're probably pasting a whole file's worth of data — drop the file directly instead, and consider Pro (100 MB) for big payloads.
Frequently asked questions
Does this fix smart / curly quotes?
No — and this is the most important thing to know. It only converts straight ' single quotes. Curly “ ” ‘ ’ from Word, docs pages, Slack, or email survive and keep the JSON invalid. Find-replace the curly quotes to straight ones (“ ” → ") in your editor first, then run this fixer for the remaining straight-quote, comma, and key issues.
Why do smart quotes break JSON?
JSON requires straight ASCII double quotes (U+0022) to delimit strings. Smart quotes are different Unicode characters — U+201C/U+201D for double and U+2018/U+2019 for single. A JSON parser only recognizes U+0022 as a delimiter, so it throws at the first curly quote. They look almost identical on screen, which is why the corruption is so easy to miss.
Can it restore backslashes that got stripped?
No. When a rich-text app strips backslashes, the information is gone — "a\nb" becomes "anb" and there's no way to know where the backslash belonged. The fixer can't infer it. Re-copy the JSON from a plain-text or code-block source where the escapes survived.
How do I prevent JSON corruption when sharing it?
Always share JSON in a plain-text context: code blocks in Slack/Teams/Markdown (triple backticks), monospace in email, or a Gist/Pastebin link. On macOS, turn off Settings → Keyboard → Text → 'Use smart quotes and dashes'. Code blocks are the single most effective prevention because the platform preserves quotes and backslashes verbatim.
What copy-paste damage CAN it fix?
Straight single quotes → double quotes, trailing commas, unquoted keys, the literal undefined → null, and a missing comma between two objects across a line break. These are the issues you get when copying from JS source via a plain-text editor — not the curly-quote/dash damage from rich-text apps.
Will the fixer change a word inside one of my strings?
No. The undefined → null pass is string-aware: it tracks string state as it walks the snippet, so it rewrites only a bare undefined VALUE and leaves the word undefined inside any string value untouched. Your pasted string content is preserved verbatim.
It still says invalid after fixing — what now?
Almost always smart quotes, stripped backslashes, em-dashes, or NBSPs remain — none of which this tool fixes. Repair those in your editor (find-replace curly quotes to straight, dashes to hyphens, NBSP to space), or re-copy from a code-block source, then run the fixer again for the leftover straight-quote/comma issues.
Should I paste the text or drop a file?
For corruption that happens during copy-paste, pasting is the realistic test — it reproduces exactly what your downstream consumer would receive. But if the snippet is large or you already saved it, drop the .txt/.json file; either way processing is local.
Can I control the output indentation?
Yes — 2 or 4 spaces, the only two options. The fixer re-serializes via JSON.stringify, so the cleaned output is uniformly indented. For compact single-line output, follow up with the minifier.
Is my pasted content uploaded?
No. Everything is processed in your browser — nothing reaches JAD Apps servers, which matters when you've pasted data from an internal tool. A signed-in run records only an anonymous counter with no content.
How do I confirm the cleaned JSON is actually correct?
The green banner means it passed JSON.parse. The only data-affecting pass is undefined→null, and it is string-aware (it changes only a bare undefined value, never the word inside a string). To be sure the fix didn't change structure, diff it against the intended structure with the JSON diff tool, or validate the shape with the JSON validator.
What's the size limit for pasted JSON?
2 MB on the free tier, 100 MB on Pro. Copy-paste snippets are almost always far smaller than that; if you're pasting megabytes, drop the file instead.
Privacy first
Conversion runs locally in your browser. No file is uploaded — only metadata counters are saved for signed-in dashboard stats.