Toolvetta

How to find and fix JSON syntax errors

To fix invalid JSON, paste it into the JSON Formatter and select Validate: it shows the exact line and column of the first error, such as a missing comma or a trailing comma. Fix that spot, validate again until the JSON is valid, then select Format to make it readable.

By Zia Ur Rehman · Tested and updated 7 November 2026 · 4 min read

Step by step

  1. Open the JSON Formatter and paste your JSON, or open a .json file.
  2. Select Validate. If something is wrong, the message names the problem with its line and column.
  3. Go to that line, fix the character, and validate again. Repeat until it says the JSON is valid.
  4. Select Format (2 or 4 spaces) to make it readable, or Minify to make it compact.

Real examples

InputMessageFix
{"name":"Toolvetta","tools":22,"free":true "private":true}Expected “,” or “}” but found “"” (line 1, column 44)Add a comma after true
An object ending in "plan": "free", then }Expected a property name in quotes but found “}” (line 4, column 1)Delete the trailing comma

These messages come from the validator on the page; your browser’s own error may be worded differently, for example “Unexpected token” or “Expected double-quoted property name”.

The six most common JSON mistakes

  • Missing comma between two values or properties.
  • Trailing comma after the last item in an object or array; JSON doesn’t allow it.
  • Single quotes: JSON strings and property names need double quotes.
  • Unquoted property names, such as {name: "x"}, which is JavaScript, not JSON.
  • Comments (// or /* */), which JSON doesn’t support.
  • Line breaks inside a string: write them as \n.

Everything runs in your browser, so API responses, tokens and config files are not sent anywhere.

Questions

What does “Unexpected token” mean in JSON?

The parser found a character it did not expect at that point, often a missing comma, a trailing comma or a single quote. Validate the JSON here to see the exact line and column.

Can JSON have comments?

No. Standard JSON does not allow comments. Remove them, or keep notes in a separate field such as "_comment".

Why does my JSON work in JavaScript but not as JSON?

JavaScript objects allow single quotes, unquoted keys and trailing commas; JSON does not. Convert those to the strict JSON rules and it will validate.

Is it safe to paste API keys or tokens here?

The validation runs in your browser and nothing is sent to a server. Still, avoid pasting live secrets anywhere you don’t need to.

More guides