How to format JSON
- Paste your JSON or open a file.
- Choose the indent, key sorting or minify.
- Copy or download the formatted JSON.
About this tool
Paste JSON and it is laid out with clean indentation, or squeezed to one line when you want it small. Choose 2, 4 or 8 spaces or a tab, and sort keys from A to Z if you want a stable order. If the JSON is broken, you see the line and column and a plain explanation. Numbers with many digits are kept exactly, instead of being rounded.
Common questions
Will large numbers lose digits?
No. Many tools read 12345678901234567890 as a rounded number. This one keeps every number exactly as you wrote it, including 1.10 and 1E+3.
Does sorting keys change my data?
It changes only the order of keys inside objects, at every level. Lists keep their order, because the order of list items usually matters.
Can it read JSON with comments?
Real JSON does not allow comments or trailing commas, so they are reported as errors. Tick Allow comments and trailing commas to read config-style files. The comments are dropped when it formats.
Is it free to use?
Yes. There's no sign-up, and you can use it as often as you like.
Is my text uploaded anywhere?
No. This tool runs inside your browser, so what you enter stays on your device.
Do I need to install anything?
No. It works in your browser on a computer or a phone.