How to format JSON
- Paste JSON in the left box, drop a .json file, or click Try an example.
- The formatted version appears on the right as you type. Choose 2 spaces, 4 spaces or tabs, and Sort keys if you like.
- Copy or Download the result.
Better than most formatters
- Exact numbers: long IDs like
12345678901234567890are kept as written; many formatters silently round them. - Clear errors: "Line 3, column 3: Expected , or } (missing comma?)", and Show the error jumps to the spot.
- Config files: tick Allow comments and trailing commas for tsconfig, VS Code settings and similar files.
Private, even for API responses
Online formatters often send what you paste to their server. Here it is formatted in your browser, so API responses with tokens or customer data stay on your machine. Need it as a table? JSON to CSV.
Private by design
The JSON never leaves your browser. Paste API responses with tokens or customer data without sending them to a server.
Troubleshooting
- "Unexpected word — text values need double quotes": the input is JavaScript, not JSON (for example
{status: ok}). Put keys and text values in double quotes. - It says the text is empty: the clipboard held nothing; copy the response body again (in browser DevTools: Network → the request → Response).
- Very large files feel slow: formatting runs as you type; for files of many MB, paste once and wait a moment.
When to use which indent
- 2 spaces — the default in most JavaScript and web projects.
- 4 spaces — common in Python projects and documentation.
- Tab — when your editor or team prefers tabs; it keeps files small too.
Checking someone else's JSON for mistakes? The JSON Validator explains each error in plain English.
Frequently asked questions
How do I pretty print JSON?
Paste it in the left box; the indented version appears on the right.
Can I sort JSON keys alphabetically?
Yes. Tick Sort keys; nested objects are sorted too.
Does it change my numbers?
No. Numbers are printed exactly as written, including very long IDs.
Is my JSON uploaded?
No. Everything runs in your browser.
Can I format JSON with comments?
Yes. Tick Allow comments and trailing commas; they are removed in the result.
Does it change the order of keys?
Only when you tick Sort keys.