JSON Minifier

Online JSON minifier that strips spaces, line breaks, and indentation to produce the smallest single-line JSON, then reports the size before and after along with the percentage saved.

FreeOnline Tool
Loading…

How to Use

  1. Paste or edit your JSON in the input box (a sample is loaded by default).
  2. Click Minify JSON and the single-line result appears below.
  3. Under the result you will see the original size, the minified size, and the percentage saved.
  4. Click Copy result to copy the minified JSON, or Clear to reset the input and the result.
  5. You can also press Ctrl+Enter inside the input box to run the minifier.

Features

  • Collapses formatted JSON into a compact single line with no unnecessary whitespace.
  • Automatically calculates and displays the original size, the minified size, and the percentage saved, measured in UTF-8 bytes.
  • Reports a clear parsing error when the JSON is malformed instead of returning an invalid result.
  • One-click copying of the minified result, plus a Ctrl+Enter keyboard shortcut.

Use Cases

Shrinking API payloads
Minify the formatted JSON config or mock data you use in development to cut down transfer size.
Slimming down logs and config files
Compress JSON logs or configuration so they can be pasted into a chat tool or ticket system without taking up dozens of lines.
Measuring the benefit of compression
Compare the before and after sizes to judge whether compressing this payload in production is worth it.
Cleaning up JSON from the clipboard
Take indented JSON copied out of a document or chat log and flatten it to one line for easy re-pasting.

FAQ

Does minifying change the data?
No. Minifying only removes formatting characters such as spaces, line breaks, and indentation. Keys, values, and structure are untouched, so it is lossless.
Why am I seeing a JSON parsing error?
It means the input is not valid JSON, for example a missing quote, an extra comma, or unbalanced brackets. Check the syntax and try again; the error message points at the specific problem.
How is the savings percentage calculated?
It is measured in UTF-8 bytes: saving = (1 - minified bytes / original bytes) x 100%. The more indentation and nesting the JSON has, the bigger the saving tends to be.
Is my JSON uploaded anywhere?
No. All the minifying happens locally in your browser and nothing is sent to a server, so JSON containing sensitive information is safe to paste.