JSON Formatter

Paste JSON to format, minify, validate, convert to YAML or query with JSONPath.

How to use it

  1. Paste JSON into the input box, or load one of the sample templates.
  2. Choose the indentation, then press Format, Minify or Convert to YAML.
  3. Copy the output or download it as a file.
  4. 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.

TechBasket Tools

Published