How to use the json formatter & validator
- Paste your JSON.
- Choose an indent, or Minify to remove all whitespace.
- Tick Sort keys to order object keys alphabetically, which makes two files easier to compare.
- If the JSON is invalid, the error shows the line and column to fix.
Common JSON errors
- Trailing commas after the last item:
[1, 2,]. - Single quotes — JSON needs double quotes around strings and keys.
- Unquoted keys like
{name: "x"}, which are valid JavaScript but not JSON. - Comments, which JSON doesn’t allow.
Examples
Formatted across four lines with 2-space indents
Invalid JSON (line 1, column 8)