JSON formatter
Paste JSON to format it, check it is valid, minify it to one line or sort its keys. Errors point to the exact line and column.
Your files stay on your device. Nothing is uploaded.
Valid, formatted JSON appears here as you type. Click ▸ to open or close any object or list.
This JSON has a mistake
How to format JSON
-
Paste your JSON
Paste JSON into the first box, for example an API response or a config file.
-
Choose the layout
Pick 2 spaces, 4 spaces, tabs or minify, and whether to sort keys A to Z.
-
Copy or download
The formatted JSON appears as you type. Copy it or download a .json file.
About this tool
Errors you can fix
Invalid JSON shows what is wrong and where, for example "Line 4, column 12: expected a comma". Common causes: a trailing comma, single quotes instead of double quotes, or a missing bracket.
Long numbers stay exact
Many formatters turn 12345678901234567890 into 12345678901234567000, because JavaScript numbers have about 15 digits. This one keeps every digit, so IDs and amounts are never changed.
Minify for size
Minify removes all spaces and line breaks, which makes JSON smaller to send or store. Sorting keys makes two JSON files easy to compare with Text compare.
Privacy
This tool runs in your browser, on your own device. Your files and text are not uploaded to our server and we cannot see them. When you close or reload this tab, they are cleared, along with the results.
Frequently asked questions
Does it change my data?
No. Only spacing changes (and key order, if you choose to sort).
Can I convert JSON to other formats?
Yes: JSON to CSV, JSON to Excel, JSON to XML and JSON to YAML.
Is my JSON uploaded?
No. It runs in your browser, so nothing you type is sent anywhere.
Are comments allowed?
No. Standard JSON has no comments, so a // or /* comment is reported as an error.
Related tools
- JSON › YAML JSON to YAML Convert JSON to clean, readable YAML as you type.
- JSON › CSV JSON to CSV Turn a JSON list of objects into a CSV table.
- XML › JSON XML to JSON Convert XML to JSON as you type, attributes included.
- Base64 Base64 encode and decode Encode text to Base64 or decode Base64 to text.
- Diff Text compare Compare two texts and see what was added or removed.
- JSON › XLSX JSON to Excel Turn a JSON list of objects into an Excel sheet.
- %20 URL encode and decode Percent-encode text for URLs, or decode it back.
- v4 · v7 UUID generator Make random UUIDs (version 4 or 7), up to 100 at once.