JSON Minify

Strip whitespace from JSON to produce the smallest valid output.

Frequently asked questions

What does minifying JSON do?

Minifying removes all unnecessary whitespace, line breaks and indentation, collapsing the JSON into the smallest valid single line. The data itself is unchanged, only the formatting is stripped.

Does minifying JSON change or lose any data?

No. Only insignificant whitespace between tokens is removed, so keys, values, arrays and objects stay identical. Parsing the minified output produces exactly the same structure as the original.

Why would I want to minify JSON?

Smaller payloads transfer faster and use less bandwidth, which matters for API responses, config bundles and anything sent over the network. Minified JSON is also handy when you need to paste a compact blob into a single field.

Can this tool also prettify or format JSON?

Yes. It can pretty-print JSON with clean indentation to make it readable, or collapse it back to one line, so it works in both directions.

Is my JSON uploaded anywhere?

No. All minifying and prettifying happens in your browser, so your data never leaves your device. That makes it safe to use with private or sensitive JSON.

What happens if my JSON is invalid?

The tool needs valid JSON to reformat it, so if the input has a syntax error such as a missing comma or unquoted key, it will report a problem rather than produce output.

Does minifying remove comments from JSON?

Standard JSON does not allow comments, so if your input contains them it is not strictly valid JSON. The safest approach is to remove comments before minifying.