Format, validate, minify JSON with JSONPath queries, tree view explorer, schema validation, diff comparison, and sort keys. Multiple indent styles
JSON is strict about syntax in ways that surprise people. The spec (RFC 8259) requires double-quoted keys (single quotes are invalid), forbids trailing commas, forbids comments entirely, and requires all strings to be UTF-8. JavaScript object literals violate most of these rules and that is the most common source of confusion: code like `{foo: 1, "bar": 2,}` is valid JavaScript and invalid JSON. This formatter validates against the JSON spec, pretty-prints the result with configurable indentation, and reports the exact line and column of any error so you can find problems fast. The formatter handles payloads up to several megabytes comfortably and does so entirely in your browser, which matters because JSON frequently contains credentials, API keys, or customer data you would rather not paste into a random online service. Under the hood it uses JSON.parse() for validation (the same parser Chrome, Firefox, and Node use, so "valid here" means "valid everywhere"), then re-serializes with JSON.stringify() and a configurable indent parameter. The collapsible tree view lets you focus on one part of a deeply nested structure without losing context of the whole.
Initializing in your browser…
Format, validate XML with XPath queries, interactive tree view, XML-to-JSON conversion, and multiple color themes
Format, validate, and convert between YAML and JSON formats. Live validation, syntax highlighting, and bidirectional conversion.
Generate JSON Schema from JSON data automatically. Infers types, formats (email, date, URI), required fields, nested objects, and arrays. Supports Draft-07 and 2020-12.
An API returned a single minified line of JSON and you need to read it and confirm it is valid before filing a bug.
Minified
{"user":{"id":7,"roles":["admin","editor"],"active":true}}Formatted + validated
{
"user": {
"id": 7,
"roles": ["admin", "editor"],
"active": true
}
}
✓ Valid JSONThe tool parses the string (rejecting it with the exact line/column if a comma or quote is wrong), then re-serialises with consistent indentation so structure is obvious at a glance. It also minifies in the other direction for shipping payloads, all locally, useful when the JSON contains data you would rather not paste into a server-side validator.
JSON is strict about syntax in ways that surprise people. The spec (RFC 8259) requires double-quoted keys (single quotes are invalid), forbids trailing commas, forbids comments entirely, and requires all strings to be UTF-8. JavaScript object literals violate most of these rules and that is the most common source of confusion: code like `{foo: 1, "bar": 2,}` is valid JavaScript and invalid JSON. This formatter validates against the JSON spec, pretty-prints the result with configurable indentation, and reports the exact line and column of any error so you can find problems fast. The formatter handles payloads up to several megabytes comfortably and does so entirely in your browser, which matters because JSON frequently contains credentials, API keys, or customer data you would rather not paste into a random online service. Under the hood it uses JSON.parse() for validation (the same parser Chrome, Firefox, and Node use, so "valid here" means "valid everywhere"), then re-serializes with JSON.stringify() and a configurable indent parameter. The collapsible tree view lets you focus on one part of a deeply nested structure without losing context of the whole.
Format minified API responses into readable JSON to inspect data structures, spot missing fields, or verify correct values.
Reformat messy configuration files with consistent indentation before committing to version control.
Catch syntax errors, missing brackets, extra commas, unquoted keys, before they cause runtime failures in your application.
Collapse and expand nested objects to understand the shape of large JSON documents from third-party APIs or databases.
Format example payloads cleanly for API docs, README files, or technical specifications.
Indentation choice has subtle practical consequences. 2-space indent is the default in most JavaScript and web tooling, it keeps nested structures readable without consuming horizontal space, which matters when JSON gets embedded in code or documentation with margin constraints. 4-space indent matches Python's convention and is easier to scan at deep nesting levels because each level is visually distinct at a glance. Tab indentation is rare in JSON but occasionally required by legacy tooling. The tool supports all three, and also a minification mode that strips all whitespace for size-sensitive transport: a 2 KB pretty-printed file typically compresses to about 1.4 KB minified, and the difference grows with nesting depth.
The error reporter is where the formatter earns its keep beyond simple pretty-printing. Common failure modes: a trailing comma after the last array element (JavaScript allows this, JSON does not), single-quoted strings (Python and JavaScript allow these, JSON does not), unquoted keys (JavaScript and YAML allow these, JSON does not), and numbers with leading zeros or trailing decimal points (JSON's number format is surprisingly strict about these). The formatter reports errors with line and column, which is enough to locate the problem in any text editor. It does not auto-correct because JSON errors are often ambiguous, a missing comma could mean "add a comma" or "remove the key after where the comma should be"and the tool cannot know your intent.
It is worth knowing what JSON does not support, because this comes up constantly in real projects. JSON has no Date type (ISO 8601 strings are the convention), no BigInt (numbers must fit in JavaScript's float64, so 2^53-1 is the safe integer ceiling and larger values silently lose precision), no comments (teams frequently want comments and invent hacks like `"_comment"` fields), no multiline strings (you need literal \n escapes), and no undefined (null is the only nothing-value). Extensions like JSON5 and JSONC add several of these (comments, trailing commas, single quotes, unquoted keys), but those are not JSON, they need their own parsers. If you are working in a pipeline that requires strict JSON (most public APIs, all RFC-compliant parsers), stick to the strict spec and use this formatter to catch violations before they cause runtime errors.
It identifies and reports syntax errors with their location, but it does not auto-correct invalid JSON. You will need to fix the issues manually based on the error messages.
The tool handles payloads of several megabytes comfortably. Extremely large files (10MB+) may slow down the browser since all processing happens client-side.
This tool validates against the strict JSON specification. Comments and trailing commas, allowed in JSON5/JSONC, will be flagged as errors.
No. All formatting and validation happens entirely in your browser. Nothing is transmitted or stored.
Your text is processed locally in the browser. Nothing you paste or open is transmitted or logged.