Skip to content

JSON minifier

Removes whitespace from one JSON value. Invalid input is not repaired.

Ctrl+Enter or ⌘+Enter runs this tool immediately.

Keys
JSON input
Minified JSON

Waiting for input.

Parsing stays in this browser. Input is not uploaded or saved.

How to use this tool

  1. Paste JSON, or load the sample.
  2. Choose Sorted to order object keys alphabetically, which makes two minified files easier to compare.
  3. Copy or download the result. The status shows the size before and after.

Supported formats and limitations

  • Only whitespace between tokens is removed. Spaces inside strings are kept.
  • Comments and trailing commas are invalid JSON and stop the minifier instead of being stripped.
  • Minified output has no newline at the end.

Examples

Indented JSON

Indentation and line breaks are removed. The values are the same.

{
  "ok": true,
  "items": [1, 2]
}

Common errors and solutions

Expected double-quoted property name
Remove the trailing comma or comment before minifying.

FAQ

Does minifying change any values?
No. Numbers, strings, and key order stay the same unless you choose Sorted keys.
How is this different from gzip?
Minifying removes whitespace from the text. gzip compresses the bytes during transfer. Servers usually do both.
Is the JSON uploaded?
No. It is minified in your browser.

Related tools

  • JSON formatter

    Validate JSON, then pretty-print it with 2 or 4 spaces or minify it. Invalid JSON produces an error and leaves the output empty.

  • JSON validator

    Check JSON syntax in the browser. Errors give a line and column, and duplicate keys that JSON.parse would silently drop are reported.

  • JSON to YAML converter

    Convert valid JSON into YAML with 2-space or 4-space indentation. Nested objects, arrays, and multiline strings are preserved, and invalid JSON is reported instead of repaired.