JSON Minifier

Paste or upload JSON and click Minify JSON to remove unnecessary whitespace and create compact, valid JSON. The tool validates first, then minifies — your data is preserved exactly and whitespace inside strings is never changed. Everything runs in your browser — your data never leaves your device.

Read the guide: How to minify JSON
3 of 3 free uses remaining today
3 minifications remaining

Input

0 chars · 0 lines
Drop a .json file to load itUp to 5.0 MB per file
Indentation:

Minified JSON

Minification results will appear here.

Your JSON is processed to perform the requested minification. Your JSON content is not included in analytics.

How the JSON Minifier works

  • Your text is parsed using the browser's built-in JSON parser in a background worker.
  • If parsing fails, the tool shows the error with the line and column where it was found.
  • If parsing succeeds, the parsed value is re-serialised with no unnecessary whitespace.
  • Whitespace inside string values is preserved exactly — only formatting outside strings is removed.

See also: JSON Validator, JSON Formatter and JSON to CSV Converter.

Examples

Nested object

{
  "name": "John",
  "age": 30,
  "active": true,
  "address": {
    "city": "London",
    "country": "UK"
  }
}

Array of objects

[
  {"id": 1, "name": "Ada"},
  {"id": 2, "name": "Alan"}
]

Useful tips

  • Minify JSON for compact API responses and smaller config files.
  • Use Format JSON to restore readability — the data stays the same.
  • Check the before/after comparison to see exactly how much you saved.

Frequently asked questions

What is a JSON Minifier?+

A JSON Minifier removes unnecessary whitespace (spaces, indentation, line breaks) from valid JSON to produce the smallest possible compact JSON. The underlying data is preserved exactly — only formatting is removed.

How do I minify JSON?+

Paste your JSON into the editor or upload a .json file, then click Minify JSON. The tool validates the input first and, if valid, produces the minified output with a before/after size comparison.

Does JSON minification remove data?+

No. Proper minification preserves the parsed data exactly. Keys, values, types, structure and whitespace inside strings are all unchanged. Only formatting whitespace outside string values is removed.

Does minifying JSON change string values?+

No. Whitespace inside string values is never removed. The string "Hello World" stays "Hello World" after minification — those spaces are part of the data, not formatting.

Why should I minify JSON?+

Minified JSON has fewer characters, which means smaller text payloads, more compact API responses and less unnecessary whitespace. This can reduce transfer size in some situations, though compression methods like GZIP typically provide larger savings.

What is the difference between JSON minification and compression?+

Minification removes formatting characters from the JSON text itself, producing smaller but still valid JSON text. Compression methods such as GZIP or Brotli encode the file using a binary algorithm that must be decompressed before reading. Minification and compression can be used together.

Can I minify a JSON file?+

Yes. Click Upload JSON File and choose a .json file. The file is loaded as text and you can minify it instantly. The maximum file size is 5 MB.

Can I format JSON after minifying it?+

Yes. Click Format JSON to pretty-print the current valid JSON with 2 spaces, 4 spaces or tabs. Formatting does not change the underlying data and does not consume your usage allowance.

Is minified JSON still valid JSON?+

Yes. The JSON specification does not require any whitespace — it only permits it for readability. Correctly minified JSON is fully valid and can be parsed by any standards-compliant parser.

Is my JSON stored when I use the JSON Minifier?+

No. Your JSON is processed entirely in your browser and is never uploaded or stored. We do not include your JSON content in analytics.

Related guides

What would you like to do next?