JSON formatter
Format, validate, query, diff, and convert JSON — up to 50MB.
Paste JSON into the input panel, then click an action below.
About this tool
A JSON formatter that stays out of your way. Paste anything from a small API response to a 50 MB log dump — the parser runs in a Web Worker so the page doesn't freeze, and the input never leaves your browser. No sign-up, no upload, no sending your data through somebody else's server to format a few curly braces.
Format with 2-space, 4-space, or tab indentation; minify back to a single line for copying into a config; or switch to a collapsible tree view that lets you explore deeply nested structures without scrolling sideways. The validator catches the usual real-world gotchas — trailing commas, single quotes, JavaScript comments, unquoted keys — and tells you exactly where the problem is. Toggle "Allow comments" and "Allow trailing commas" to parse JSONC-style files (like tsconfig.json or VS Code settings) and emit strict JSON as output.
Diff mode compares two JSON blobs structurally, so reordered object keys don't produce false positives — only real changes show up. That makes it useful for reviewing API response changes between two environments, or checking what actually differs between two config files with identical semantics but different ordering. Convert mode turns an array of flat objects straight into CSV in one click, ready to paste into a spreadsheet.
How to use this tool
-
Paste or upload
Paste JSON into the left pane, drag a
.jsonfile into the window, or click the upload button. The formatter handles files up to 50 MB. -
Format or minify
Toggle between pretty-print (indented, one key per line) and compact (one-line, no whitespace). The diff and JSONPath panels work against whichever view is active.
-
Validate, query, or convert
The side rail unlocks more: schema validation, JSONPath queries, semantic diff against another JSON document, and CSV/YAML export. None of it leaves your browser.
Frequently asked questions
What's "semantic diff" and why should I care?
A text diff between two JSON documents flags every reordered object key as a difference, which is usually noise. The semantic diff here compares by structure and keys, so {"a":1,"b":2} and {"b":2,"a":1} show as equal — only real changes appear.
My JSON has comments or trailing commas. Will it parse?
Strict JSON doesn't allow either, but many real-world files (tsconfig.json, VS Code settings) use them. Toggle "Strip comments" and "Allow trailing commas" under Options and it will parse, then emit strict JSON as output.
Where's JSON Schema validation?
Coming in a follow-up build — we're vendoring Ajv for proper Draft 7+ support. JSONPath queries and YAML/TOML conversion are queued in the same phase. The chips on the page mark them as coming.
Is my data safe? What happens to what I paste?
The input never leaves your browser. Parsing, formatting, diffing, and CSV conversion all run locally in a Web Worker. No JSON is uploaded to our server, logged, or sent to any third party. You can open the browser's network tab and watch: when you click Format, nothing goes out.
What's the largest file the formatter can handle?
Around 50 MB, depending on your device's available memory and CPU. The parser runs off the main thread so the UI stays responsive while large files are processed. For multi-gigabyte files, a command-line tool like jq or a streaming parser will serve you better than any browser-based tool.
Can it format config files like tsconfig.json?
Yes. Files like tsconfig.json and VS Code's settings.json use JSONC — JSON with comments and trailing commas. Toggle "Allow comments" and "Allow trailing commas" in the Options panel. The formatter will parse JSONC input and emit strict JSON on output, so you can copy the cleaned version somewhere a stricter parser will accept it.
Does it support JSON5 or YAML?
JSON5-style leniency (unquoted keys, single-quoted strings, NaN / Infinity literals) isn't on yet — JSONC-style leniency (comments + trailing commas) is. YAML conversion is planned but not shipped; it's one of the chips marked "Coming soon" on the tool page.
JSONC vs JSON5 vs strict JSON — which does this support?
Strict JSON by default, with a tolerant fallback that accepts single-line // comments and trailing commas (the JSONC subset). JSON5 features like unquoted keys aren't supported — if you need full JSON5, convert it first.
Does the formatter strip comments from my data?
Only on output. The parser preserves comment locations internally, but standard JSON output strips them. If you want to keep comments, copy the source rather than the formatter output.
Troubleshooting
- Why does it say 'Unexpected token' on line 1, column 1?
The file has a UTF-8 byte-order mark (BOM) at the start. Some tools emit one, JSON parsers don't tolerate it. Open your file in a text editor and save without BOM, or strip the first three bytes (
0xEF 0xBB 0xBF).- Why does formatting hang on my 40 MB file?
The formatter holds the whole document in browser memory. 40 MB of nested JSON can balloon to several hundred MB of in-memory object tree. Try a streaming parser like
jqat the command line for files that big; this tool is designed for human-scale documents.- Why doesn't JSONPath find my key?
JSONPath is case-sensitive and respects exact key names.
$.User.emailwon't match a key calleduser. If your key contains special characters or spaces, escape it:$['my key'].