QA Toolbox logoQA Toolbox

JSON Minifier

Collapse JSON into a single compact line.

About JSON Minifier

The JSON Minifier collapses formatted JSON into a single compact line by stripping all insignificant whitespace. Minified JSON is what you want when pasting a payload into a cURL command, a test fixture, an environment variable or a query parameter, where line breaks either break the command or just get in the way.

Minification is lossless — the data is parsed and re-serialized, so the output is guaranteed to be valid, equivalent JSON. It also acts as a validation step: if the input does not parse, you get the error instead of a silently broken one-liner.

How to use

  1. Paste formatted JSON into the input box — the single-line version appears immediately.
  2. If there is a syntax error, fix the input using the message shown; the output updates as you type.
  3. Copy the minified line into your cURL command, fixture file or config value.

Frequently asked questions

Does minifying change my data?

No. The input is parsed and re-serialized without whitespace, so keys, values and their order are preserved exactly as the JSON standard defines them. Only formatting is removed.

Why minify JSON at all?

Single-line JSON is easier to embed in shell commands, HTTP headers, environment variables and test data files, and it is slightly smaller to transmit. Multi-line payloads often break quoting in terminals.

Can I un-minify later?

Yes — paste the minified output into the JSON Pretty Printer to get the formatted version back at any indentation you like.

Related tools