How do I format JSON?
Paste your raw or minified JSON into the box above and click 'Format & validate'. The tool will check that it's valid JSON and, if so, re-print it with your chosen indentation. If it isn't valid, you'll see an error explaining what's wrong and roughly where to find it.
Use the settings to switch between 2-space, 4-space or tab indentation, sort every object's keys alphabetically, or minify the output down to a single line with no whitespace at all.
What is JSON?
JSON (JavaScript Object Notation) is a lightweight, text-based format for structuring data as key/value pairs, arrays and nested objects. It's the de facto standard for APIs, configuration files and data interchange between servers and browsers because it's easy for both humans and machines to read.
Why format or validate JSON?
JSON returned from an API or stored in a config file is often minified into a single unreadable line. Formatting it with consistent indentation makes the structure easy to scan, spot missing commas or brackets, and compare against other payloads.
Validating catches syntax errors, such as trailing commas, unquoted keys or mismatched brackets, before they cause problems further down the line in your application.
Is my data sent anywhere?
No. Everything happens in your browser using JavaScript, nothing is uploaded or stored, so it's safe to use with sensitive data.
What does 'sort keys alphabetically' do?
When enabled, the keys of every object in your JSON are reordered alphabetically before formatting. This is useful for diffing two JSON documents, since key order otherwise has no effect on meaning but can make differences harder to spot.
What's the difference between formatting and minifying?
Formatting ('pretty printing') adds line breaks and indentation to make JSON easy to read. Minifying strips out all unnecessary whitespace to produce the smallest possible payload, which is useful when you need to embed JSON somewhere size-sensitive, like a URL query parameter.
How do I pull specific values out of JSON?
Type a JSONPath expression into the filter box above the output. For example, $.items[*].name returns the name of every item, $..price finds every price at any depth, and $.items[?(@.price < 10)] keeps only the items that cost less than 10. The result is always shown as an array, in every view.
If you'd rather match text than structure, the regex tester can help you build a pattern, and the hash generator is handy if you need to fingerprint a payload for caching or comparison.
What is the tree view for?
The tree view lets you fold and unfold objects and arrays, so you can focus on one part of a large document. Click any key to copy its path, or use the copy button on a row to copy that value.
How do I validate JSON against a schema?
Open the JSON Schema panel and paste your schema. Each time the JSON changes, the tool checks it against the schema and lists every problem with the path to the value that caused it. It supports the common keywords from JSON Schema draft-07 and later, including required, properties, items, enum, pattern, anyOf, oneOf and local $ref references.
Which formats can I convert JSON to?
The Convert tab produces YAML, CSV, XML and TypeScript types. CSV works with an array of objects, and nested objects become columns such as address.city. The TypeScript output infers an interface for each object and marks keys that are missing from some items as optional.