Search tools

Find a tool by name or what it does.

JSON Minifier

Minify JSON to the smallest single line, with original vs minified byte size and the percentage saved.

Validated and minified live as you type. Nothing leaves your browser.

Output

Result

Minified JSON and the byte savings will appear here.

How to minify JSON online

  1. Paste your JSON

    Drop raw JSON into the input, where it is validated and minified live on every keystroke.

  2. Read the byte savings

    The output collapses to one compact line and the size cards show the original bytes, the minified bytes, and the percentage saved.

  3. Switch to Beautify if needed

    Flip to Beautify to pretty-print the same document with 2 spaces, 4 spaces, or tab indentation instead.

  4. Copy the result

    A Valid JSON note confirms the input parsed, and Copy to clipboard takes the current output.

Why use this tool

Smallest single-line output

Minify strips every space, tab, and newline between tokens and emits the JSON as one compact line, the smallest form standard parsers accept.

Size saved, in bytes and percent

Cards compare the original byte size against the minified byte size and show exactly how much smaller the payload became.

Beautify toggle with indentation choice

Switch the same input to a pretty-printed view with 2 spaces, 4 spaces, or tab indentation when you need it readable rather than small.

Precise error on invalid JSON

Malformed input shows the exact parse error, typically including the character position where parsing failed, so you can fix it fast.

Lossless by design

Only insignificant whitespace is removed. Every key, value, and array order is preserved, and numbers keep their standard representation.

Runs entirely in your browser

Everything happens on your device; nothing is uploaded.

About this tool

This JSON minifier validates your JSON and rewrites it as the smallest single line a standard parser will accept. As you type or paste, the document is re-parsed and re-emitted with every space, tab, and newline between tokens removed, and the size cards report the original byte size, the minified byte size, and the percentage saved. When parsing fails, the exact error is shown inline, usually pinpointing the character position that broke.

Minifying is lossless: it strips only the whitespace that carries no meaning, so keys, values, and array order are untouched and numbers keep their standard representation. The result loads anywhere standard JSON is accepted, which makes it useful for shrinking API response bodies, trimming config blobs before you embed them in a script or an HTTP request, and cutting the size of a payload you are about to send over the wire.

When you want the document readable instead of compact, the Beautify toggle pretty-prints the same input with 2 spaces, 4 spaces, or tab indentation. Everything runs on your device, so response bodies full of records or keys never leave the tab. For a fuller editor with a collapsible tree, use the JSON formatter, and to reshape a valid document into other formats try JSON to CSV or JSON to YAML.

Frequently asked questions

How does the JSON minifier work?
Paste or type JSON and it is parsed and re-emitted live as you type. Minify removes every unnecessary space, tab, and newline to produce a single compact line, and the size cards show how many bytes you saved. The copy button copies the result to your clipboard.
Does minifying change my data?
No. Minifying is lossless. It removes only the insignificant whitespace between tokens, so every key, value, and the order of array items are preserved. Numbers are written in their standard form, so a value like 1.0 becomes 1, but it stays numerically identical.
What happens when my JSON is invalid?
The tool shows the parse error inline, typically including the position where parsing failed, so you can find the problem quickly. Nothing crashes and your input is left untouched while you fix it.
How is the size and percentage saved measured?
Both the original and minified figures are measured in bytes using the same encoding a file or network request would use, so multi-byte characters count correctly. The percentage saved is the reduction from the original byte size to the minified byte size.
What is the Beautify option for?
Beautify pretty-prints the same document with your choice of 2 spaces, 4 spaces, or tab indentation instead of collapsing it to one line. It is handy when you need to read or diff the JSON rather than shrink it, and Copy still gives you whichever view is showing.
Is my JSON uploaded or stored anywhere?
No. All parsing, minifying, and measuring happens locally in your browser. Your data never leaves your device, never touches a server, and is not logged.

Related tools