JSON Formatter & Validator
Paste JSON to check and reshape it. When it will not parse, the error says what is wrong in plain words and points at the line and column, instead of quoting a character offset.
Press Esc to clear
Formatted
About the JSON Formatter & Validator
Every JSON parser can tell you that a document is invalid. Almost none of them tell you anything useful about where. The browser's own message names a character offset — position 412 — which is precise, useless, and worded differently in every engine. Finding position 412 in a 400-line file by counting characters is not a thing anyone should do.
This tool converts that offset into a line and column, and rewrites the message into something actionable. A missing comma, a single quote where JSON requires a double, a trailing comma before a closing brace, an unterminated string: each of those produces a different engine message on different browsers, and each gets translated into a sentence that says what to fix.
Formatting is the other half. Two-space indentation is the convention for most codebases and four for others; minifying strips every byte that is not data, which is what you want before putting JSON into a URL, a header or an environment variable. Sorting keys is the underrated option: two JSON documents that differ only in key order are identical as data but produce a diff full of noise, and sorting both before comparing removes it.
The structure summary counts keys, values, arrays, objects and nesting depth. Depth is the number worth watching — deeply nested JSON is usually a sign that an API is returning a shape that will be painful to consume.
Everything runs in your browser. JSON is the format people most often paste without thinking about what is in it — tokens, customer records, internal identifiers — and none of it leaves the tab.
Frequently asked questions
Why does the error point at a line instead of a character position?
Because a character position is unusable. The browser reports something like "position 412", which nobody can find by eye. The offset is converted here into a line and column that map onto what you are actually looking at.
What does sorting keys do?
It reorders object keys alphabetically at every level of nesting. Two documents that differ only in key order are the same data but produce a diff full of noise; sorting both first removes it.
Is my JSON uploaded anywhere?
No. Parsing and formatting happen in your browser. That matters here more than on most tools, since JSON is the format people paste tokens and customer records into without thinking.
You might also need
- Developer
JSON ↔ CSV Converter
Convert JSON to CSV and back, flattening nested objects into dotted column names.
- Developer
YAML ↔ JSON Converter
Convert between YAML and JSON in both directions, with a warning about lost comments.
- Developer
SQL Formatter
Format SQL for readability across ten dialects, or minify it back to a single line.
- Developer
JWT Decoder
Decode a JSON Web Token, read every claim, check expiry, and verify an HS256 signature.