Format JSON and find syntax errors before copying it

Use formatting, minification and validation with a small JSON example; understand trailing commas, duplicate keys and large-number limitations.

How do I format and check a JSON response?

Paste JSON into JSON Formatter, choose Format for readable indentation or Validate only to check syntax, then run the tool. Fix errors in the original input before copying the result. Valid syntax does not prove the data matches your API schema.

Open JSON Formatter & Validator

Step by step

  1. Copy the JSON body, not HTTP headers or a JavaScript variable assignment. Keep the original if it contains important data.
  2. Choose Format (2-space indent), paste the input and run the tool. Nested objects and arrays appear on separate lines.
  3. For a syntax check, choose Validate only. A trailing comma or an unquoted property name must be corrected; the tool does not repair it automatically.
  4. Use Minify to one line only when compact output is needed. Copy the result and check it against the receiving application's field requirements.

A worked example

Checked using the local JSON Formatter in a browser with the sample below.

Input
{"name":"Vubilo","items":[1,2],"active":true}
Setting
Format · 2-space indentation
Observed
3 top-level keys; items contains 2 values; active remains true

This small example verifies the displayed formatting only. It does not test large documents, schema compliance or arbitrary-precision numbers.

Try a small response first

Use {"name":"Vubilo","items":[1,2],"active":true}. Formatting expands the two array items and keeps the boolean as true. Whitespace is presentation; it is not a change to the intended values.

Try {"name":"Vubilo",} to see a syntax error, then remove the final comma. Do not convert all quotes by blind replacement: apostrophes may be legitimate text inside strings.

What this check cannot guarantee

The implementation parses JSON using JavaScript numbers. Very large integers can lose precision; represent identifiers as quoted strings before using this tool. Duplicate object keys can collapse to the last value. Keep the original when either matters.

Validation checks JSON syntax, not business rules, required API fields or a JSON Schema. Avoid pasting secrets into shared devices, and do not assume formatted output is a lossless archive of the original text.

More questions

Can I paste comments or a JavaScript object?

Not as JSON. Remove comments and variable declarations, quote property names and remove trailing commas. This tool does not accept JSON5.

Does minification encrypt my data?

No. It removes formatting whitespace. Anyone with the output can still read the values.

Sources and further reading

Files are processed by the tool in your browser. This does not mean the website makes no network requests. Read the privacy policy.

Try JSON Formatter & Validator