JSON formatter
To format JSON, paste it into the box and press Format JSON. Pick an indent first, or press Minify JSON to remove all spaces and line breaks.
Stays on your device
Nothing you type is sent
Works as you type
No file needed
Copy or download
Nothing is saved
How it works
- Paste your JSON into the box.
- Pick an indent of 2 spaces, 4 spaces or tabs, and tick the option to sort keys if you need it.
- Press Format JSON, or press Minify JSON to remove all spaces and line breaks.
- If the JSON is not valid, read the error. It gives the line and column where the JSON goes wrong.
- Copy the result with the Copy text button.
Facts
- Where it runs
- In your browser. What you type is not sent anywhere or saved
- Indent
- 2 spaces, 4 spaces or tabs
- Sort keys
- An option sorts object keys from A to Z
- Checked by
- The browser's own JSON parser
- Errors
- The error message, with the line and column where the JSON goes wrong
Questions
How do I format JSON online?
Paste the JSON, pick an indent, and press Format JSON. The indented JSON is the result, and you can copy it with the Copy text button.
What is the difference between formatting and minifying JSON?
Formatting adds indents and line breaks so people can read the JSON. Minifying removes all spaces and line breaks, which makes the JSON as short as it can be.
Why does my JSON show an error?
The text is not valid JSON. The error shows the line and column where it goes wrong, which is often a missing comma or quote, or an extra comma before a closing bracket.
Does the JSON leave my browser?
No. Your browser checks and formats the JSON, and nothing you paste is sent to a server.