JSON Formatter
Paste JSON to format, minify, validate, convert to YAML or query with JSONPath.
- Size:
- Depth:
- Keys:
- Arrays:
- Savings:
Output
Copied to clipboard.
How to use it
- Paste JSON into the input box, or load one of the sample templates.
- Choose the indentation, then press Format, Minify or Convert to YAML.
- Copy the output or download it as a file.
- To pull out part of the data, type a JSONPath expression and press Query.
Valid JSON uses double quotes for keys and strings, no trailing commas and no comments. The stats row reports the output size, nesting depth, key count and array count.
Frequently Asked Questions
Is my JSON sent to a server?
No. Formatting, minifying, YAML conversion and JSONPath queries all run in your browser, so the JSON you paste stays on your device.
Why does the formatter say my JSON is invalid?
The tool parses your input with the browser JSON parser and shows its error message. The usual causes are a trailing comma after the last item, single quotes instead of double quotes, unquoted keys, and comments, none of which are allowed in JSON.
What happens with duplicate keys?
JSON allows them to be written, but parsers keep only the last value. The tool warns you with the key name and line number so you can remove the duplicate.
What does Minify do?
It removes all whitespace so the JSON takes the fewest bytes. The stats row shows the size and the percentage saved compared with the indented version.
How do I query part of my JSON?
Enter a JSONPath expression such as $.store.book[*].author in the query box and press Query. The matching values appear below the box as JSON.
More tools
Regex Tester
Test regular expressions against sample text with live match highlighting.
Cron Expression Generator
Build cron expressions and read them in plain English.
Base64 Encoder / Decoder
Encode and decode Base64 with UTF-8 and URL-safe support, or turn a file into a data URL.
JWT Decoder
Decode JSON Web Token headers and payloads locally.
UUID Generator
Generate random UUIDs in bulk.
Hash Generator
Create SHA-1, SHA-256, SHA-384 and SHA-512 hashes of text or files in your browser.
Published