How to use JSON Formatter
- Paste your JSON into the left box, drop a file on it, or use Upload or From URL.
- Pick an indent size. Turn on key sorting if you want the keys in alphabetical order.
- The result appears on the right as you type. Switch to Tree view to fold and unfold nested objects.
- Use Copy or Download to take the result with you.
About JSON Formatter
Most JSON you meet in real life is not pretty. It comes out of an API as one long line, or from a log file with half the quotes escaped, or from a colleague who pasted it into chat. This formatter turns it into something you can actually read, and it tells you straight away if the JSON is not valid.
Everything happens in your browser tab. Your data is not sent to our server, which matters when the JSON contains customer records, tokens or anything else you would rather keep to yourself. Large numbers such as 12345678901234567890 are kept exactly as you typed them, so IDs do not get silently rounded the way they do in many other tools.
What the error messages tell you
When the JSON is invalid you get the line and column, the line itself with a caret under the problem, and a plain explanation such as "Trailing comma is not allowed in JSON". Click Go to error and the cursor jumps to the right spot.
The Fix JSON button handles the usual suspects: single quotes, unquoted keys, trailing commas and comments. Always read the result before you use it, because a repair tool has to guess what you meant.
Tree view and search
The tree view is handy when the document is big. Click a key to copy its path, for example $.items[0].sku. The search box looks through keys and values and opens the branches that match.