JSON Minifier
Strip whitespace, indentation and line breaks from JSON to reduce its size.
Paste messy or minified JSON and get clean, indented, readable output instantly. Errors are pinpointed by line and column, and your data never leaves your browser.
Paste or type to begin. Everything runs in your browser.
How it works
Paste JSON, drop a .json file onto the input, or load the sample.
Pick 2 spaces, 4 spaces or tabs. Sort keys alphabetically if you want a stable order.
Copy the formatted result or download it. Syntax errors show the line and column.
About this tool
A JSON beautifier, also called a JSON formatter or pretty printer, takes compact or unstructured JSON and reformats it with consistent indentation, line breaks and spacing. The data doesn't change; it just becomes much easier to read, navigate and debug.
It's useful whenever you're working with API responses, config files, logs or database exports. Because the formatter has to parse the JSON first, it also works as a quick JSON validator: if something's wrong, such as a trailing comma or a missing quote, you'll see exactly where.
2 spaces, 4 spaces or tabs to match your project's style.
Optionally sort object keys A–Z for stable diffs and easier comparison.
Invalid JSON is reported with the line and column of the problem.
Formatting runs locally, so API keys and customer data stay on your machine.
FAQ
Yes. The JSON is parsed before it's formatted, so any syntax error is reported along with where it occurs. If you see formatted output, your JSON is valid.
No. Only whitespace changes. Keys, values and order stay the same unless you choose to sort keys.
Common causes are trailing commas, single quotes instead of double quotes, unquoted keys, comments, and values like undefined or NaN, none of which are allowed in standard JSON.
No. This tool runs entirely in your browser using JavaScript. Your files and text never leave your device, so it's safe for private or confidential work.
Missing something?
Instant.tools grows from real requests. Describe the task you're stuck on and we'll consider building it next.