JSON Formatter & Tree View
Data, Regex & TextFormat & inspect JSON trees, convert JSON/YAML/CSV/TOML, generate TypeScript/Zod, and beautify SQL/XML/HTML.
100% client-side — files and inputs never leave your browser.
About this tool and how it works
Formatting and validating JSON
Paste a minified API response, a config file, or a log line and the formatter pretty-prints it with consistent indentation. If the JSON is invalid, it points to the exact line and column of the first error instead of a generic "Unexpected token" message. A collapsible tree view lets you explore deep objects and copy the JSONPath of any node (for example $.data.items[3].price) for use in tests, jq, or monitoring rules.
The most common JSON errors
- Trailing commas:
[1, 2, 3,]is valid JavaScript but invalid JSON. - Single quotes: strings and keys must use double quotes.
- Unquoted keys:
{name: "x"}must be{"name": "x"}. - Comments: standard JSON has no comments; strip them or use JSONC/JSON5 tooling.
- Special values:
NaN,Infinity, andundefinedare not allowed.
Sort keys for clean diffs
Two JSON documents with identical data but different key order look completely different in a diff. Enable sort keys to order every object alphabetically (recursively), then compare the results in the Diff Checker to see only real changes.
Minify for transport
Minifying removes all insignificant whitespace, which shrinks payloads for fixtures, environment variables, or single-line log entries. Formatting and minifying never change the data itself.
Large numbers
JavaScript represents numbers as 64-bit floats, so integers above 9,007,199,254,740,991 (253−1) lose precision when parsed. If your API returns 64-bit IDs, transmit them as strings.
Frequently asked questions
Why does the validator reject JSON that works in my JavaScript code?
JavaScript object literals allow single quotes, unquoted keys, trailing commas, and comments. Strict JSON (RFC 8259) does not. The error position shows which rule is broken.
Can I format JSON that is several megabytes large?
Yes. Parsing runs in your browser, so the limit is device memory. For very large files the tree view is slower than the plain formatted text.
What is JSONPath used for?
JSONPath is an address for a value inside a document, such as $.user.emails[0]. It is used in API tests, log queries, and tools like jq or Postman to extract fields.
Other tools
Convert bidirectionally between JSON, YAML, CSV, and TOML in your browser.
Generate TypeScript interfaces and Zod schemas from any JSON payload.
Beautify or minify SQL queries (Postgres/MySQL), XML, and HTML markup.
Live regex matcher, capture groups, replace preview, and quick presets.
Compare text, JSON, or code side-by-side or in unified diff view.
Convert camelCase/snake_case/slugs, count bytes/words, and deduplicate lines.
Live GFM preview, HTML export, and Markdown table generator from CSV/TSV.
Create direct wa.me links with pre-filled messages and downloadable PNG QR codes.
Merge, split, compress, rotate pages, and convert between PDF and images 100% locally.