JSON Formatter & Validator

Beautify, minify and validate JSON instantly. Everything runs in your browser.

Result appears here…
Advertisement

What this tool does

This tool parses your JSON to confirm it is valid, then re-prints it with clean, consistent indentation (formatting) or with all unnecessary whitespace removed (minifying). If the JSON is invalid, it shows the error message so you can locate and fix the problem.

Example

The compact input {"name":"Ada","langs":["EN","FR"]} formats to a readable, indented structure. Minifying reverses that — useful for reducing payload size in APIs and config files.

Common JSON rules

  • Keys and string values must use double quotes, not single quotes.
  • No trailing commas after the last item in an object or array.
  • Allowed values: strings, numbers, true, false, null, objects, and arrays.
  • Comments are not allowed in standard JSON.

Limitations

  • JSON cannot represent undefined, functions, dates, or NaN/Infinity.
  • Very large numbers may lose precision because JSON numbers are parsed as standard floating-point values.
  • This validator checks syntax only — it does not validate against a schema. A JSON Schema validator is on our roadmap.

How to fix common errors

  • “Unexpected token”: usually a missing comma, an extra comma, or single quotes instead of double quotes.
  • “Unexpected end of JSON input”: a bracket or brace was not closed.
  • Keys not quoted: wrap every key in double quotes, e.g. {"id": 1}.
Privacy: Your JSON is parsed locally in your browser and never uploaded.
Advertisement