Skip to main content
NeatUtility

JSON Minifier

JSON & Data100% Client-Side
Ready
JSON
0 lines0 chars
0 B / 4.77 MB
About this tool, examples & FAQ

Parse valid JSON and re-serialize it without structural whitespace, entirely in your browser. Spaces inside string values are preserved, and invalid input produces an actionable syntax error with line and column.

Key facts

Verified capabilities and limits of this utility
Accepted inputJSON text: objects, arrays, strings, numbers, booleans, or null
OperationSingle fixed operation with no options: parse, then serialize without extra whitespace
Max input size5 MB
Execution deadline2 s
Processing locationBrowser-only: pasted input is not uploaded

How to use

  1. Paste your formatted or spaced JSON into the editor.
  2. Click 'Run' to minify the JSON.
  3. If the input is invalid, read the reported line and column, fix the syntax error, and run again.
  4. Use 'Copy' or 'Download' to retrieve the compact output, or use 'Send To' to pipe it into another utility such as Base64 or Hash.

Example

Minify an indented config

Input

{
  "message": "hello world",
  "count": 2
}

Example output

{"message":"hello world","count":2}

Edge cases

Spaces inside strings

Whitespace characters inside string values are preserved; only whitespace between structural tokens is removed. Escape spellings inside strings may still be rewritten (see below).

Escape sequences

Escape sequences inside strings may be rewritten even though the parsed character is unchanged: for example, "\u0041" becomes "A".

Duplicate keys

Duplicate object keys are not reported: the last value wins during parsing, matching JSON.parse behavior.

Number precision

Values follow standard JavaScript JSON precision: integers beyond 2^53 - 1 may lose least-significant digits, and out-of-range literals such as 1e999 do not survive the round trip.

How it works

  1. Rejects empty or whitespace-only input before parsing.
  2. Parses the input with the platform JSON parser and converts engine diagnostics into line and column indicators.
  3. Serializes the parsed value with no indentation or extra whitespace.
  4. Executes inside a Web Worker bounded by the tool deadline.

Frequently asked questions

Is minification the same as compression?

No. Minification removes unnecessary whitespace from the JSON text. It does not apply gzip or Brotli compression, and it does not change HTTP headers.

Does minification change my data?

The parsed data is preserved, with three caveats: whitespace inside strings is kept but escape sequences may be rewritten, duplicate keys collapse to the last value, and numbers follow standard JavaScript JSON precision.

What happens with invalid JSON?

Minification fails with an actionable syntax error reporting line and column. Fix trailing commas, single quotes, comments, or unclosed braces and run again.

Should I still use gzip or Brotli for transport?

Yes. Minifying shrinks the payload text, and transport compression such as gzip or Brotli shrinks it further on the wire. They complement each other.

How do I make minified JSON readable again?

Paste the compact output into the JSON Formatter and choose 2-space, 4-space, or tab indentation to pretty-print it.

Is my pasted input uploaded anywhere?

No. Minification runs inside an isolated Web Worker in your browser, and pasted input is not uploaded for processing. The browser still requests site assets from the host; clipboard, downloads, and analytics are separate boundaries.

References