Compact API payloads
Create a concise version of a request body for tests, examples, or command-line usage.
Free browser tool
This JSON minifier converts valid JSON into compact one-line output. It removes indentation, line breaks, and extra spaces while preserving the same data structure. Minified JSON is useful for embedding payloads in examples, reducing file size, preparing snippets for environments that prefer compact text, or comparing normalized values.
The minifier first parses the input to make sure it is valid JSON. If the input has a syntax problem, it shows an error instead of producing broken output. The result can be copied directly from the page, and all processing happens in your browser.
Compress valid JSON into compact one-line output.
A JSON minifier removes whitespace that is not part of string values. The output is usually a single line, which makes it smaller and easier to embed in places where compact text is preferred. The data does not change: object keys, values, arrays, booleans, numbers, and null stay the same. Only indentation, spaces, and line breaks outside strings are removed.
Minification is useful when you need compact examples, normalized payloads, test fixtures, or a value that must be pasted into an environment variable or command-line argument. It can also make two pieces of JSON easier to compare as raw strings because both are normalized into a predictable compact representation.
The minifier validates first. That is important because removing whitespace from invalid text would create misleading output. If the input cannot be parsed as JSON, the tool reports the syntax problem and leaves the result empty. For human review, use the formatter. For compact transport or storage, use the minifier.
Create a concise version of a request body for tests, examples, or command-line usage.
Some configuration systems expect single-line JSON strings. Minification makes those values easier to paste.
Minified JSON can reduce noise in snapshots or quick comparisons when formatting is not important.
Whitespace is usually small, but minification can still help when embedding static JSON in constrained places.
The minified version contains the same JSON values but removes all unnecessary whitespace.
{
"feature": "search",
"enabled": true,
"limits": {
"pageSize": 20
}
}{"feature":"search","enabled":true,"limits":{"pageSize":20}}Minification is not gzip or Brotli compression. It only removes whitespace from text.
The tool must parse the input first. Invalid JSON needs to be fixed before it can be minified.
Whitespace inside strings is data and is preserved. Only whitespace outside values is removed.
Compact JSON is harder to inspect. Format it again when humans need to read or debug it.
Create compact JSON for examples and payloads.
Normalize JSON before comparison or storage.
Avoid minifying invalid data by accident.
Store readable JSON in docs or repositories, then minify only when compact output is required.
A successful minify action confirms the input is valid JSON and safe to reuse syntactically.
Do not paste production secrets or private tokens unless you are certain the workflow is appropriate.
When compact JSON behaves unexpectedly, format it to inspect nested data and field names.
Formatted JSON is for humans, minified JSON is for compact transport. The data is the same, but the workflow is different.
Learn when to format JSON, how online formatters work, and what to check when formatting fails.
Trailing commas, bad quotes, comments, unclosed brackets, and undefined values are the JSON mistakes developers hit most often.
No. It only removes whitespace outside strings while keeping the same values.
No. The tool validates the input before creating compact output.
Yes. Use Copy Result after minifying.
The tool runs in your browser and does not require login, a database, or server-side processing.