DevTools.

JSON Minifier

Paste JSON to strip every unnecessary space and line break. The data is unchanged, and invalid JSON is reported with its line and column.

0 characters · Ctrl/Cmd+Enter format · Ctrl/Cmd+Shift+Enter minify

How to use

  1. Paste your JSON into the input panel, or press Sample to load an example.
  2. Minify is already selected. The compact result appears in the output panel.
  3. Copy it or download it as minified.json.
  4. Switch to Format at any time to turn it back into readable JSON.

Example

Input

{
  "name": "Ada",
  "skills": [
    "math",
    "code"
  ],
  "active": true
}

Output

{"name":"Ada","skills":["math","code"],"active":true}

Common use cases

  • Embedding JSON in a script, HTML attribute or environment variable.
  • Reducing the size of a payload or static data file.
  • Putting a request body on a single line for a command line or a log entry.
  • Producing compact test fixtures.

Common mistakes

  • Expecting minification to rename keys or shorten values. Only whitespace outside strings is removed.
  • Minifying invalid JSON. The input is parsed first, so syntax errors must be fixed before there is any output.
  • Pasting JSON with comments, which standard JSON does not allow.

Frequently asked questions

Does minifying change my data?

Values and key order are preserved, and whitespace inside strings is kept. Duplicate keys collapse to the last value, and integers beyond 9007199254740991 can lose precision because they are parsed as JavaScript numbers.

How much smaller will my JSON get?

It depends on the original formatting. Deeply indented, pretty-printed JSON shrinks the most, and JSON that is already compact barely changes.

Is minified JSON the same as compressed JSON?

No. Minifying removes whitespace but stays readable text. Transport compression such as gzip works on top of it and is complementary.

Is my JSON uploaded anywhere?

No. Everything runs in your browser and your input is never sent, logged or stored.