How to use the JSON formatter
- Paste your JSON into the Input box. It's validated as you type.
- Click Format / Beautify to pretty-print it with your chosen indentation, or Minify to strip all whitespace.
- If there's a syntax error, the exact line and column are shown and the cursor jumps there.
Common JSON errors and how to fix them
| Error | Wrong | Right |
|---|---|---|
| Trailing comma | {"a": 1,} | {"a": 1} |
| Single quotes | {'a': 'b'} | {"a": "b"} |
| Unquoted keys | {a: 1} | {"a": 1} |
| Comments | {"a": 1 // note} | JSON does not allow comments |
| Missing comma | {"a": 1 "b": 2} | {"a": 1, "b": 2} |
What is JSON?
JSON (JavaScript Object Notation) is a lightweight text format for structured data. It's the standard way web APIs exchange data, and it's used for configuration files such as package.json. It supports objects, arrays, strings, numbers, booleans (true/false) and null.
Frequently asked questions
Is my JSON sent to a server?
No. Parsing and formatting use your browser's built-in JSON engine, so API keys, tokens and private data in your JSON stay on your device.
Can it handle large files?
Yes. Files of several megabytes format in well under a second on modern devices.
What does "Sort keys" do?
It orders every object's keys alphabetically, at all nesting levels. That makes two JSON documents much easier to compare.