Skip to content
Tools

JSON formatter & validator

Format, validate, and minify JSON.

About the JSON formatter & validator

This JSON formatter pretty-prints, minifies, and validates JSON text. Use it when an API response or log line arrives as one long string, when you need to shrink JSON before pasting it into a config or request body, or when you want to know exactly why a parser is rejecting your data.

How to use it

  1. Paste your JSON into the Input box, or click Load sample to try it with example data.
  2. Choose an Indent setting, then click Format to pretty-print, or Minify to remove all whitespace.
  3. Click Validate to check the syntax without producing output. A Valid JSON or Invalid label appears above the input.
  4. Copy the result from the Output box. Reset clears both fields.

Error messages

Invalid input shows your browser's JSON parser error below the input, which usually includes the position of the problem.

Strict JSON only

Parsing follows the JSON standard, so comments, trailing commas, single-quoted strings, and unquoted keys are reported as errors.

Privacy

Formatting and validation run in your browser with JavaScript. The JSON you paste is not sent to a server.

Questions

Why does my JSON fail to validate?
The most common causes are a trailing comma after the last item, single quotes instead of double quotes, unquoted property names, and comments. All of these are allowed in JavaScript objects but not in JSON.
What is the difference between formatting and minifying JSON?
Formatting adds line breaks and indentation so the structure is easy to read. Minifying removes all optional whitespace to make the text as small as possible. The data is the same.
Does formatting change my data?
The values stay the same, but the output is rebuilt from the parsed data. Very large integers beyond JavaScript's safe range can lose precision, and number formats such as 1.0 or 1e3 are written as 1 and 1000.