JSON Formatter
Format messy or minified JSON into readable, indented text, or compress it back into a single line, all inside your browser.
Input JSON
When you're working with an API response, a config file, or data that came from somewhere else, you often end up with minified JSON: everything squeezed onto a single line, impossible to read at a glance. This tool reformats it with proper indentation and line breaks so you can actually read it, and it also does the reverse: it compresses a nicely formatted JSON file down into one compact line when that's what you need.
How to format JSON
Paste your JSON
Copy the JSON text, minified or just messy, and paste it into the text box. It doesn't need to be in any particular shape — the tool processes it exactly as it comes.
Choose format or minify
Click 'Format' to lay it out with two-space indentation and line breaks, or click 'Minify' for the opposite: everything collapsed into a single line.
Copy the result
The processed JSON appears instantly, ready to copy with one click and paste wherever you need it — your code editor, your documentation, or a config file.
What it's useful for
- An API returns its response as a wall of minified text, and you need to read it clearly to find a specific field or track down a bug.
- Someone sent you a config JSON copied from a chat or forum thread, all squeezed onto one line, and you want to review it before dropping it into your project.
- You have a nicely formatted JSON file in your editor and need to compress it into a single line to paste into an environment variable or shrink a file's size.
Frequently asked questions
Does the JSON I paste get uploaded to a server?
No. All the processing happens in your browser using JavaScript: the text never travels over the internet and is never stored anywhere. Close the tab and it's gone for good.
Why does it say my JSON is invalid when I copied it from a real API?
This tool can only format JSON that's already syntactically valid. Common mistakes like a trailing comma, an unquoted key, or a missing quotation mark will make parsing fail, and the tool shows you the exact error message and where in the text the problem is — but it won't fix it for you automatically.
Is the JSON formatter free, and is there a usage limit?
Yes, it's free with no limit on how many times you use it: since nothing gets uploaded to a server, there's no cost to pass on to you. We don't ask for sign-up or an email address either.
What's the difference between formatting and minifying?
Formatting adds two-space indentation and line breaks so the JSON is easy to read. Minifying does the opposite: it strips out every unnecessary space and line break to collapse it into one compact line, which is handy when file size matters.
Can it fix a JSON file that has syntax errors?
No. The tool detects and describes the error, but it won't guess at or automatically fix a trailing comma, a missing quote, or an unquoted key. You'll need to correct the text by hand and try again.