JSON Formatter
Format and validate JSON. Runs entirely in your browser.
Input JSON
Paste your unformatted JSON here.
Formatted JSON
Result will appear here...Pretty-printing is a round trip, and round trips change things
This formatter does not reflow your text. It parses the document into real values and then serialises those values back out with two-space indentation. The tidy output is a side effect of that round trip, which is worth understanding, because a round trip quietly normalises several things along the way.
Duplicate keys collapse. If an object contains the same key twice, the parser keeps the last one and the earlier value disappears from the output. That is standard behaviour, and it is usually the first sign that something upstream generated the document badly. Numbers are canonicalised too: 1.0 comes back as 1, 1e3 as 1000, and any precision beyond what a double can hold is gone before it reaches the output. Escaped characters resolve to the characters they denote, so a unicode escape becomes the literal symbol. Key order, on the other hand, is preserved exactly as written.
The parse step is the validator
Because formatting requires parsing, invalid input cannot produce output at all. You get the parser's own error, naming the position it gave up at, instead of a mangled document. That makes this a strict checker rather than a forgiving one, which catches a specific class of mistake: JSON has no comments, no trailing commas, no single-quoted strings, and no unquoted keys.
So a file that a code editor happily accepts may well be rejected here. VS Code settings files are JSONC, which allows comments. Some tooling accepts JSON5, which allows all of the above. Both look like JSON and neither is. A rejection is the formatter telling you the document would fail against a strict parser somewhere else, which is exactly what you want to find out before shipping it to an API.
What it deliberately does not do
There is no schema validation here: well-formed JSON with the wrong fields in it is still well-formed, and checking shape against a contract is a different job. There is no key sorting, because reordering keys changes a document that some consumers treat as ordered. And the output is always indented rather than minified, since the point of this page is reading a document, not shipping the smallest possible bytes.
Doing this locally matters more for JSON than for most formats. API responses, service-account credentials, webhook payloads and config files are where bearer tokens and secrets live, and pasting one into a remote formatter hands it over. Here the document is parsed by your own browser's JSON parser and never becomes a network request.
JSON Formatter FAQ
Does this tell me if my JSON has a syntax error?
Is there a size limit on the JSON I can format?
Does formatting JSON here send my data anywhere?
Other data & developer utilities tools
All Data & Developer Utilities- Geodata ToolsConvert and project spatial files (KML, GPX, GeoJSON).
- QR Code GeneratorGenerate beautiful, customizable offline QR codes.
- Hash GeneratorGenerate MD5, SHA-1, SHA-256, and SHA-512 hashes.
- Base64 Encoder/DecoderEncode text/files into Base64 or decode back.
- URL Encoder/DecoderPercent-encode or decode URL query strings securely.
- Data GeneratorGenerate realistic mock data sets in JSON/CSV formats.