JSON Viewer, Formatter & Validator
View, format, validate and explore JSON as a tree, table or graph, with JSONPath, jq and JSON Schema. Runs in your browser.
Runs in your browser. Nothing is uploaded.
Selected
- JSONPath
- JavaScript
- Type
Paste JSON to see it as a table.
Paste JSON above to see it as a graph.
JSONPath cheat sheet
| Syntax | Meaning |
|---|---|
$ | The root of the document |
.name or ['name'] | A child property (use brackets for keys with spaces) |
[0], [-1:] | An array item by index; the last item |
[0:3] | A slice: items 0, 1 and 2 |
[*] | Every item or property |
..name | name at any depth (recursive descent) |
[?(@.price < 10)] | Filter: items whose price is under 10 |
[?(@.tags)] | Filter: items that have a tags property |
[0,2] | Several indexes at once |
Try a common filter
How to use the JSON Viewer, Formatter & Validator
- Paste your JSON into the left box, open a .json file, or press Load example.
- The result appears on the right as you type. Choose Format for readable output or Minify for a single compact line.
- If the JSON is invalid, read the message under the boxes and press Go to error to jump to the exact spot.
- Pick 2 spaces, 4 spaces or tabs, and tick Sort keys if you want properties in alphabetical order.
- Copy the result or download it as a .json file.
What a JSON formatter does
JSON (JavaScript Object Notation) is the most common way programs exchange data. APIs return it, configuration files are written in it, and databases export it. To save space, machines often produce JSON as one long line with no spaces at all. That is efficient to send but almost impossible for a person to read. A formatter, sometimes called a beautifier or pretty printer, adds line breaks and indentation so every object and array is laid out on its own level and you can see the structure at a glance.
This tool does the reverse as well. Minify strips every unnecessary space and line break, which is useful when you want to paste JSON into a single-line field, shrink a payload, or compare two documents without whitespace getting in the way.
Validation with exact error positions
Before anything is formatted, the input is checked against the JSON standard. When something is wrong, you get the line and column of the first problem and a plain-language explanation instead of a cryptic “unexpected token”. The checker recognises the mistakes people make most often:
- Trailing commas after the last item in an object or array
- Single quotes or unquoted property names, which are valid in JavaScript but not in JSON
- Missing commas between items, usually after editing by hand
- Python-style values such as
True,FalseandNone - Comments, which some editors allow but JSON does not
Fix the reported problem and the result updates immediately, so you can work through a broken file one error at a time.
Readable, consistent output
Choose two spaces, four spaces or tabs to match the style of your project. Turning on Sort keys orders properties alphabetically at every level, which makes two versions of the same document much easier to compare and keeps files tidy in version control. The status bar also shows how many keys the document contains, how deeply it is nested, and its size in bytes.
Viewing JSON as a table
Many API responses and exports are lists of records. The Table tab lays a list out in rows and
columns, one column per field, so you can scan values such as prices or statuses at a glance. Pick
which list to show, click a column header to sort, and type in the filter box to keep matching rows.
Nested objects open as their own table, or tick Flatten nested fields in Options to get columns
like customer.name. Copy or download the view as CSV for a spreadsheet.
Private by design
Everything happens on your own device. The page never sends your JSON anywhere, which matters when the data contains customer records, access tokens or internal configuration. Your last input is remembered in your browser so you can pick up where you left off, and you can clear it at any time.
Frequently asked questions
Is my JSON uploaded anywhere?
No. Formatting and validation happen in your browser with JavaScript. Nothing you paste is sent to a server, so it is safe to use with private API responses or configuration files.
Why does it say my JSON is invalid when it works in JavaScript?
JavaScript object syntax is more relaxed than JSON. JSON requires double quotes around every property name and string, does not allow trailing commas or comments, and only accepts lowercase true, false and null.
How large a file can I format?
Files up to 50 MB can be opened. Inputs over about 200,000 characters are processed in a background thread so the page stays responsive, but very large files still depend on your device's memory.
Does sorting keys change my data?
Sorting only changes the order of properties inside objects. Values and array order stay exactly the same, and JSON parsers treat objects with the same keys as equal regardless of order.
Why did a very long number change after formatting?
Browsers store JSON numbers as 64-bit floating point values, which are exact only up to 9,007,199,254,740,991. Larger IDs lose precision when parsed. If you need them exact, store them as strings in your JSON.
Tutorials
How to fix invalid JSON from an API response
Find and fix the errors that make JSON invalid, such as trailing commas, single quotes and unquoted keys, using the line and column the formatter reports.
How to minify JSON for a config field or API request
Turn formatted JSON into one compact line for environment variables, API requests and single-line fields, then expand it again.