JSON formatter and validator
Format, minify and check JSON, see exactly where it is broken, and find your way in it as a tree. It runs on your device: nothing is sent.
How it works
Paste JSON on the left, type it, drop a file on it, or open one. The result appears on the right as you type.
- Format writes it out with one value to a line, indented by 2 spaces, 4 spaces or a tab.
- Minify writes it on one line with no spaces, the smallest it can be.
- To YAML writes the same data as YAML, indented by 2 or 4 spaces (YAML allows no tabs). Numbers keep the way they were written, and a string YAML would read as something else, such as
yes,1.0or2026-11-26, is put in quotes. - Sort keys puts every object’s keys in alphabetical order.
When the JSON is broken
The first problem is named in words, with its line and column, and marked in the input. The most common ones are a comma after the last item ({"a": 1,}), a key without double quotes ({a: 1}), single quotes, a missing comma between two items, and a comment, which JSON does not allow. A key that appears twice in the same object is valid JSON, but only its last value counts: the formatter says so.
Finding your way in it
Choose Tree to see the data as a tree. Each object and list folds and unfolds, with its number of keys or items. Search for a key or a value: every match is found, its branches opened, and Enter goes to the next. Choose a value to see its path, such as $.store.books[2].title, and copy the path or the value. The arrow keys move through the tree.
Querying the data
Choose Query to ask the data a question in JSONPath, the standard way to point into JSON (RFC 9535). $ is the whole document, .name a key, [0] the first item and [-1] the last, [1:3] a slice, [*] everything, ..name a key at any level, and [?…] a filter, where @ is the item being tested: $.store.books[?@.price < 10].title gives the titles of the books under $10. Filters take == != < <= > >=, && || ! and the functions length, count, match, search and value. See what was found as a JSON list, or as its Paths.
Questions and answers
Is the JSON I paste sent anywhere?
No. It is read, checked and formatted in your browser, on your device. Nothing you paste or open is uploaded, and nothing is kept once you close the page.
Why does it say where the problem is, and not only that there is one?
The formatter reads the JSON itself, character by character, so it knows the line and the column where it stopped and why. "Show me" puts the cursor there.
Are large numbers kept as they are?
Yes. Numbers are written back exactly as they were typed, so an identifier such as 12345678901234567890 is not rounded, as it would be by many formatters.
Can it open a large file?
Yes, up to 50 MB. A large input is worked on in the background, with its progress shown, so the page stays responsive; Cancel stops it.
What does "Sort keys" do?
It writes the keys of every object in alphabetical order, at every level. The order of the items in a list never changes.
Runs on your device. Nothing you type or open is sent anywhere.