Unformat.online

Fix JSON Errors Online

Paste broken JSON and get valid, formatted JSON back. Auto-fixes single quotes, trailing commas, and unquoted keys — the three most common JSON mistakes.

Rules:Smart QuotesConverts curly quotes (“” ‘’) to straight quotes. Always active.Non-Breaking SpacesReplaces non-breaking spaces (U+00A0) with regular spaces. Always active.Line EndingsNormalizes CRLF → LF and trims trailing whitespace per line. Always active.Removes invisible zero-width characters (U+200B, U+200C, U+200D) that silently break string comparisons.Strips the Byte Order Mark (U+FEFF) that causes “invalid character” errors in parsers and editors.Removes soft hyphens (U+00AD) from PDFs that show as garbled characters in code editors.Converts mixed tabs/spaces to a consistent indent width. Click to pick a size.Collapses all line breaks into one continuous paragraph. Great for reflowing PDF or email text.Control blank line density. Click to pick Keep 1 or Remove all.Text never leaves your browser
0 characters

What JSON errors are auto-fixed?

The most common JSON syntax errors come from hand-editing or from copying JavaScript object literals. Here are the three we fix automatically:

ErrorBeforeAfter
Single quotes{'key': 'value'}{"key": "value"}
Trailing comma{"key": "value",}{"key": "value"}
Unquoted keys{key: "value"}{"key": "value"}

If your JSON has errors beyond these three, the tool will show an error message with the exact location of the problem so you can fix it manually.

Why does JSON have stricter syntax than JavaScript?

JSON was designed for data interchange, not human convenience. It requires double quotes for all strings (including keys), prohibits trailing commas, and forbids comments. Many developers copy JavaScript object literals into JSON files and are surprised when parsers reject them — those literals are valid JavaScript but invalid JSON.