JSON Formatter, Validator and Viewer
Beautify, validate and minify JSON with exact error locations. Repair broken JSON in one click, explore it as a tree, filter with JSONPath and convert to YAML or CSV.
- Line and column errors
- One-click repair
- JSONPath filter
- Runs in your browser
Your formatted JSON appears here.
Processed in your browser – your JSON is never uploaded. Press Ctrl+Enter in the input to copy the result.
Insights
Add some JSON to see its structure and any problems.
How to format and validate JSON
- Paste or open your JSONPaste JSON into the left box, open a .json file or drop one onto the box. Press Sample to try it first.
- Check and fix errorsInvalid JSON is flagged with the exact line and column. If it’s a common mistake – comments, single quotes, trailing commas – press Fix JSON.
- Format, explore or convertChoose Format, Minify, Tree, YAML or CSV. Use the path filter to pick part of the data, then copy or download the result.
Common JSON errors and how to fix them
| Wrong | Right | Why |
|---|---|---|
{'name': 'Ada'} | {"name": "Ada"} | JSON only allows double quotes |
{name: "Ada"} | {"name": "Ada"} | Property names must be quoted |
[1, 2, 3,] | [1, 2, 3] | No comma after the last item |
{"ok": True} | {"ok": true} | Literals are lowercase: true, false, null |
// comment | remove it | JSON has no comments |
{"n": 007} | {"n": 7} | No leading zeros, + signs or bare .5 |
{"x": NaN} | {"x": null} | NaN and Infinity aren’t JSON |
Path filter cheat sheet
| Path | Selects |
|---|---|
$.address.city | One nested value |
$.orders[0] / $.orders[-1] | First / last item of an array |
$.orders[*].total | The total of every order |
$.orders[1:3] | Items 1 and 2 (a slice) |
$..id | Every id at any depth |
$["first name"] | A key with spaces or symbols |
Click any key in the tree view to see its path, then copy it for use in code – for example data.orders[0].id in JavaScript or jq '.orders[0].id'.
Frequently asked questions
How do I know if my JSON is valid?
Paste it in – the badge above the input shows Valid JSON or Invalid JSON instantly. For invalid JSON you get the line, column and a plain-English reason, with the exact spot marked.
What can “Fix JSON” repair?
Comments, single or curly quotes, unquoted property names, trailing or missing commas, Python values like True and None, NaN and Infinity, unescaped line breaks inside strings and several values on separate lines (JSON Lines). The fixes are listed before you apply them, and Undo takes you back.
Is my JSON uploaded anywhere?
No. Parsing, formatting and conversion all happen in your browser. Your data never leaves your device, so it’s safe for API keys and private data – though it’s still wise to remove secrets before sharing.
Why do large numbers keep their exact value?
Most online formatters use JavaScript’s JSON.parse, which rounds integers above 9,007,199,254,740,991 – so an ID like 9007199254740993 silently changes. This tool keeps every number exactly as written and warns you when a number is too large for JavaScript.
How do I use the path filter?
Type a JSONPath such as $.orders[0].id, $.orders[*].total or $..id. Use [*] for every item, [1:3] for a slice, [-1] for the last item, ["key name"] for keys with spaces and .. to search at any depth.
How does JSON to CSV work?
An array of objects becomes one row per object, with a column for every key. Nested objects become columns like address.city, and arrays are written as JSON text in a cell. The CSV includes a byte order mark so Excel opens accents and symbols correctly.
What does duplicate key mean?
The same property name appears twice in one object, like {"a":1,"a":2}. It’s technically allowed but most parsers keep only the last value, so it’s usually a bug. The tool lists each duplicate’s path.
How large a file can it handle?
Files up to 20 MB. Syntax highlighting switches off above about 400 KB to keep the page responsive, and the tree view shows big arrays 200 items at a time.
Related tools
Last updated: