I copied JSON out of a WhatsApp message or a Word document and now it is invalid even though it looks fine. What happened?
Usually the quotes. Chat apps and word processors sometimes replace the straight double quote " with curly quotes “ and ”, and JSON does not accept those. The JSON formatter points at the first curly quote by exact line and column, so you can see it and retype it yourself; it does not replace them for you.
Two marks that look alike
JSON knows exactly one quote mark: the straight one on your keyboard. The curly pair, opening “ and closing ”, are completely different Unicode characters, and Word and some phone keyboards insert them automatically because they look nicer in ordinary text. On screen, especially in a small font, the difference is barely visible.
So the familiar scenario plays out: a developer or support agent sends you a settings snippet in a message, or you copy it from a Word how-to document, paste it into your store dashboard or a file, and it is rejected even though everything seems in place.
What it looks like in the tool
Here is a short text with curly quotes around the key name:
{“name”: "oud"}
The tool reports: Invalid JSON, error at line 1, column 2. In a Chromium-based browser the parser message reads something like Expected property name or '}'. Column 2 is the “ right after the brace, where the parser expected a straight quote to open the key name. The tool also highlights the offending character in the line it shows.
If the curly quote sits in a value rather than a key, say "note": “gift” at the end of a long line, the tool points to its column just the same, column 25 in our example. When the browser's message gives no position, the tool finds it by scanning the text and tells you so.
How to fix it
- Open the JSON formatter and validator and paste the text as you copied it.
- Read the line and column, and press 'Go to the error position' to put the cursor on the mark.
- Delete the curly quote and type a straight one from your keyboard in its place.
- The tool moves straight on to the next error if there is one; repeat until you see 'Valid JSON'.
- Copy the formatted output, which is now clean text you can paste wherever you need it.
If the text is long with many curly quotes, replace them all at once with find and replace in a plain text editor before pasting, then run it through the tool to confirm. The tool itself replaces nothing, because an automatic fix could change a quote inside Arabic text or a quotation you wanted kept as it is.
Other culprits of the same kind
- A non-breaking space or hidden character at the end: some apps add one when copying, and the tool flags it as an unexpected character after the end of the JSON. To clean odd spacing out of ordinary text, try the Whitespace cleaner.
- A single quote ' instead of a double one: not curly, but not accepted in JSON either.
- Arabic guillemets « » typed in place of quotes.
Avoiding it in the first place
Ask whoever sends you JSON to send it as an attached file rather than text inside the message, or inside a code block if the platform supports one. And never edit JSON files in Word; use a plain text editor.
Common questions
Does the tool replace curly quotes automatically?
No. It shows you where each error is, and you decide on the fix.
Do curly quotes inside a valid string value matter?
No. Inside a value wrapped in straight quotes, such as a product name containing a quotation, they are just characters in the text and stay valid.
Why is the error message in English?
It comes from the browser's own parser, and its wording varies a little between browsers. The line and column are what matter most.
