Skip to content
PocketDesk
Your files are processed on your device, never uploaded

JSON minify

  • On device
Input
Ln 1, Col 11 line0 BUTF-8

Paste, drop or open a file in Input to see the result here.

Waiting for input
  • ⌘Enter Run now
  • ⌘⇧C Copy result
  • ⌘F Find in result
  • Esc Exit full screen
  • Use Ctrl instead of ⌘ on Windows and Linux

How to minify JSON

  1. Paste your JSON into Input, drop a .json file on the page, or press Open file.
  2. The result appears on one line as you type. Turn on Sort keys if you want a stable order.
  3. Select Copy to put it on your clipboard, or Download to save minified.json.

The status bar shows the size of the result. If the input is not valid JSON, you see the line and column of the problem instead of a result.

What minifying does

JSON allows spaces, tabs and line breaks between its tokens. They help people read the file and mean nothing to a parser. Minifying removes all of them, so { "a": 1, "b": [ 1, 2 ] } becomes {"a":1,"b":[1,2]}. Spaces inside strings are never touched, because they are part of the data.

When to minify

  • Smaller payloads. Less to send in API responses, config bundles and local storage entries.
  • One-line values. Environment variables, query parameters and test fixtures often need JSON on a single line.
  • Stable diffs. Combined with Sort keys, two files with the same data produce the same text, which makes comparing easy with the JSON compare tool.

Tips

  • Check syntax first with the JSON validator if you only need a yes or no.
  • Need to read the result again? Use the JSON formatter and choose an indent.
  • Escape sequences such as \n and é inside strings stay as written, so the data is not altered.
  • Very large files are processed in a background thread, so the page stays responsive.
  • Keep a pretty-printed copy in version control for people to read, and minify only the copy you ship or paste into a single-line setting.

Privacy

API payloads often contain tokens or customer records. This tool never sends your text anywhere, and nothing is stored or logged.

Questions

How much smaller does minified JSON get?

It depends on how much whitespace the file has. Pretty-printed JSON with 2-space indentation often shrinks by 15 to 40 percent; JSON that is already compact barely changes.

Does minifying change my data?

No. Only spaces, tabs and line breaks between values are removed. Keys, values and array order stay exactly the same unless you turn on Sort keys.

Can I turn minified JSON back into readable JSON?

Yes. Paste it into the JSON formatter and pick 2 spaces or 4 spaces. The structure is identical.

Is minified JSON the same as compressed JSON?

No. Minifying removes optional characters. Gzip or Brotli compress the bytes further, and servers usually apply them on top of minified JSON.

Is my JSON uploaded?

No. The work happens in your browser and nothing is sent anywhere.

More developer tools