JSON Minifier
Remove all insignificant whitespace from JSON while preserving every value.
- Runs locally in your browser
- No upload required
Try it
Supported formats
Privacy
Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.
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
- Tokenize the document with the F054 verbatim JSON scanner.
- Validate the token stream against RFC 8259 before transforming anything.
- Re-emit the tokens with no optional whitespace.
Usage
- Paste or type a JSON document.
- Run the tool to get the smallest valid JSON text.
- 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
{
"text": "{\n \"a\": 1,\n \"b\": [2, 3]\n}"
}Strings untouched
{
"text": "{ \"note\": \"keep spaces\" }"
}Big integer preserved
{
"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
Send feedback
Tell us if this tool helped, report a problem, or suggest a tool. Only the message you type is sent — never the input you used in the tool.
Was this tool useful?
Prefer to write to us directly? See the contact page.