Fix Broken JSON Online

Paste invalid JSON, see the exact error, and get a corrected version instantly.

Common Causes of Broken JSON and How to Fix Them

Broken JSON usually comes from hand-editing config files, copying from JavaScript objects, or truncated API responses. The most common errors are trailing commas after the last item in an array or object, single quotes instead of double quotes, unquoted keys, and missing closing brackets.

JavaScript is forgiving — it allows trailing commas, single quotes, and unquoted keys. JSON is not. When you copy an object literal from your code and paste it into a config.json or API request body, these differences will break parsing. Our formatter identifies the exact character position of the error so you can fix it immediately.

Another common source of broken JSON is truncated responses — when a large API response gets cut off in a log file or terminal buffer. If you see Unexpected end of JSON input, the JSON was likely incomplete. Paste it here to see how far the valid JSON extends and what's missing.

Tips

  • Trailing commas: {"a": 1, "b": 2,} is invalid JSON. Remove the comma after the last element.
  • Single quotes: {'key': 'value'} is JavaScript, not JSON. Replace with double quotes.
  • Comments: JSON does not support // or /* */ comments. Remove them or use JSONC/JSON5.
  • Unquoted keys: {key: "value"} is invalid. All keys must be double-quoted: {"key": "value"}.

Ready to get started?

Open JSON Formatter

New tools every week

Get notified. No spam.