JSON Minifier

Remove all insignificant whitespace from JSON while preserving every value.

  • Runs locally in your browser
  • No upload required

Try it

Paste JSON. It is minified in your browser and never uploaded.

Minified JSON
{"name":"gampangin","tags":["json","minify"]}

Supported formats

Input
text
Output
text

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

Minified 27 characters of JSON to 17 characters.

How it works

  • Scanned the JSON into a syntax tree without converting number literals to JavaScript numbers.
  • Removed all whitespace that is not inside a string.
  • Re-emitted the tokens with the shortest valid separators.
  • Number literals are copied verbatim, so large integers keep their exact value.

Methodology

  1. Tokenize the document with the F054 verbatim JSON scanner.
  2. Validate the token stream against RFC 8259 before transforming anything.
  3. Re-emit the tokens with no optional whitespace.

Usage

  1. Paste or type a JSON document.
  2. Run the tool to get the smallest valid JSON text.
  3. Copy the result; the input never leaves your browser.

Examples

These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.

Whitespace removed

jsonSelect to copy
{
  "text": "{\n  \"a\": 1,\n  \"b\": [2, 3]\n}"
}

Strings untouched

jsonSelect to copy
{
  "text": "{ \"note\": \"keep  spaces\" }"
}

Big integer preserved

jsonSelect to copy
{
  "text": "{ \"id\": 123456789012345678901234567890 }"
}

Limitations

When to minify

Minified JSON is smaller on the wire and in storage. Because string contents are never touched, a minified document is the same value as the original.

Frequently asked questions

Does minifying change my numbers?
No. Number literals are copied as text, so even integers too large for JavaScript numbers are preserved exactly.
Why was my malformed JSON rejected?
Minifying requires a valid document; the reported line and column point at the first syntax error.
Is my data uploaded?
No. The document is processed entirely in your browser and is never sent anywhere.

Sources

  1. RFC 8259 — The JavaScript Object Notation (JSON) Data Interchange Format — IETF
  2. MDN Web Docs — JSON — MDN