Data tools

JSON Minifier

Validate and minify standard JSON or JSON Lines while reporting bytes saved.

Processed locally in your browser. Your input is not uploaded to our server.

0 characters
Minification options
0 characters

Enter or load data to begin

How to use JSON Minifier

  1. Paste JSON or open a local .json or .jsonl file.
  2. Select standard or JSON Lines mode and decide whether to sort object keys.
  3. Confirm validity and byte savings before copying or downloading the minified result.

Supported behavior

JSON Minifier removes insignificant JSON whitespace only after the input parses successfully. In standard mode its result matches JSON.stringify of the parsed value; JSON Lines mode validates and minifies each non-empty record independently. An optional recursive key sort can make object serialization deterministic without changing array order. Before and after UTF-8 byte totals, bytes saved, and percentage reduction show the actual effect rather than implying that every document shrinks substantially. Invalid input produces no minified output, so a malformed payload cannot be mistaken for a processed one. The operation changes presentation, not the represented JSON data, although parsing necessarily applies JavaScript behavior to duplicate keys and numeric precision. Your pasted document or selected .json or .jsonl file is validated and serialized entirely in your browser and is never uploaded. Minification is not compression or encryption, and whitespace inside JSON string values remains meaningful and untouched.

  • Minification does not gzip, encrypt, or shorten property names and string values.
  • Duplicate keys and unsafe integers retain the limitations of JavaScript JSON parsing.

Examples

                {
  "name": "Ada",
  "active": true
}
              

Result: {"name":"Ada","active":true}

                [ 1, 2, "a  b" ]
              

Result: [1,2,"a b"]

Common use cases

  • Reduce a JSON fixture before embedding it in a static asset.
  • Normalize JSON Lines records to one compact value per line.
  • Compare payload size before and after insignificant whitespace removal.

Frequently asked questions

Is the output still valid JSON?

Yes. Standard output is the JSON.stringify serialization of a successfully parsed value.

Are spaces inside strings removed?

No. Only insignificant syntax whitespace is removed; string content stays unchanged.

What happens with invalid input?

Validation is shown and no minified output is produced.

Does key sorting affect arrays?

No. It changes object-key order recursively while preserving array element order.