JSON Formatter & Validator

Paste JSON to format, validate or minify it instantly.

βœ“ Valid JSON

How to format JSON

  1. Paste your JSON into the input box.
  2. Choose 2 spaces, 4 spaces, tabs or minify, and sort keys if you like.
  3. Copy the result, or fix the error at the line and column shown.

Why format JSON

API responses and log lines often arrive as one long line. Indented JSON shows the nesting of objects and arrays at a glance, which makes it much easier to find a field, spot a missing value or review a config change.

Reading error positions

The validator reports the line and column where parsing stopped. The real mistake is usually just before that point: a missing comma or quote on the previous line, or a trailing comma before } or ].

JSON versus JavaScript objects

JSON is stricter than JavaScript: keys and strings need double quotes, and comments, trailing commas, undefined and NaN are not allowed. Large integers above 2^53 lose precision when parsed in JavaScript, so APIs often send IDs as strings.

Frequently asked questions

Is my JSON sent to a server?

No. Formatting and validation run in your browser with the built-in JSON parser, so API responses and config files stay on your device.

What are the most common JSON errors?

Trailing commas after the last item, single quotes instead of double quotes, unquoted keys and comments. JSON allows none of these.

What does minify do?

It removes all spaces and line breaks that are not inside strings, giving the smallest valid JSON for sending or storing.

Why sort keys?

Sorted keys make two JSON documents easier to compare, for example before using the text compare tool.