JSON Formatter & Validator

Validate, format, or minify JSON; syntax errors are reported with position and reason.

Text & DataInstant

Parameters

Result

Fill in the parameters and run

Format, minify and validate JSON

The JSON formatter does three things: re-indents a minified one-line JSON payload with 2-space indentation so it becomes readable; minifies indented JSON down to a single line to shrink payloads; and validates syntax only. When the input is invalid, the tool reports where and why parsing failed — a missing comma, an unclosed quote, a trailing comma — instead of leaving you to hunt through hundreds of lines by eye.

Parsing uses the browser's native JSON.parse, entirely on your device. Nothing is uploaded, so it is safe to paste responses that contain internal endpoints or test data.

JSON for APIs and configuration files

API responses are usually served minified; paste one here and the structure becomes obvious. Check syntax before saving strict JSON files such as package.json. VS Code's settings.json, tasks.json, and launch.json use JSONC, which allows comments and accepts trailing commas with a warning; strict JSON validation is not suitable for judging those files directly. This tool checks JSON syntax, not JSON Schema compliance. When digging through logs, formatting the embedded JSON and then searching is far faster than reading raw text.

The reverse direction is just as common: minify JSON before embedding it as mock data or pasting it into a field with a size limit.

JSON syntax rules and data types

This tool uses JSON.parse and accepts strict JSON only: keys must use double quotes, and trailing commas, comments, single-quoted strings, and undefined are not allowed. Text with comments may be JSONC, JSON5, or another format; comments alone do not identify JSON5. JSON5 also supports syntax such as single-quoted strings and unquoted keys. Removing comments alone may not produce valid JSON: convert all unsupported syntax or use a parser that matches the original format.

Also note that JSON has no date, regex, or binary types (they must be strings), and key order carries no semantic meaning even though this tool preserves it in the output.

What does JSON linting check here?

Choose Validate only to check strict JSON syntax without reformatting your input. This JSON linting check identifies parsing errors; it does not validate a JSON Schema, enforce style rules, or verify that values are correct for your application.

Fix trailing commas and unquoted keys

Trailing comma: {"name":"Ada",} is invalid. Remove the comma before the closing brace to get {"name":"Ada"}.

Unquoted key: {name:"Ada"} is invalid. Put double quotes around the key to get {"name":"Ada"}. Paste either corrected example into the input and choose Validate only. The tool reports syntax errors; it does not repair them automatically.

Can formatting JSON change large numbers or duplicate keys?

Yes. Parsing and serialization use JavaScript. Integers beyond Number.MAX_SAFE_INTEGER (9,007,199,254,740,991) can lose precision; duplicate object keys keep only the last value. Store exact identifiers as strings and keep the original input when these details matter.

Loading assistant…