Skip to content

JSON Minify

JSON Minify compresses JSON in your browser. Paste an object, array, or API payload, parse it locally with JSON.parse, then copy compact one-line output by default. Optional Pretty mode reprints with two-space indent so you can verify before you copy. Nothing is uploaded, stored in localStorage, or sent to a formatter API. Invalid JSON (trailing commas, comments, single quotes) is rejected so the copy stays RFC 8259.

This page is minify-first: paste JSON and get a compact single-line payload you can drop into a config field, a log line, or an API body. Switch to Pretty only when you want to read the structure before you copy. Closing the tab drops the workspace; we do not write it to localStorage or send it to a formatter API.

Parsing uses the browser's JSON.parse. Trailing commas, comments, and single quotes are rejected with an error next to the input — the output stays standard RFC 8259 JSON. Character counts for input and output appear when the JSON is valid so you can see how much whitespace was removed.

JSON minify workspace

Minify

Paste an object, array, or API response. Standard JSON only — no comments or trailing commas. Default mode is Minify.

Output

Minified JSON will appear here.

Minify-first sibling of JSON Formatter. Closing the tab drops the workspace — nothing is uploaded or written to localStorage.

How does the JSON Minify work?

  1. 1. Paste JSON

    Drop in an object, array, or JSON text — including typical copy from an API response. A fictional India-safe example is available from Load example.

  2. 2. Parse locally

    The browser's JSON.parse runs in this tab. Invalid JSON (trailing commas, comments, single quotes) gets an error next to the input; we do not send the blob anywhere.

  3. 3. Minify (default) or Pretty

    Minify collapses valid JSON to a single compact line. Switch to Pretty for two-space indent when you want to verify the structure before copying. A character count shows input versus output length when the JSON is valid.

  4. 4. Copy the result

    When the JSON is valid, copy the output. Closing the tab drops the payload.

Questions about JSON Minify

What does JSON Minify do?
It minifies JSON in your browser. Paste an object, array, or API payload, and it parses with JSON.parse then reprints a compact single-line form by default. Optional Pretty mode adds two-space indentation so you can verify the structure. Invalid JSON is rejected with an error rather than silently patched.
Does JSON Minify upload my payload?
No. Parsing and formatting run in the browser with JSON.parse / JSON.stringify. There is no account and no server-side formatter. The text you paste stays in this tab until you clear it or close the page. We do not write it to localStorage. That is the same privacy rule as JSON Formatter and XML Formatter on this hub.
How is this different from JSON Formatter on this hub?
JSON Formatter at /developer/json-tidy/ defaults to pretty-print and also offers minify plus an optional sort-keys control. JSON Minify at /developer/json-minify/ is the minify-first sibling for the "json minify" query — compact output is the primary mode, with Pretty only as a verify step, and no sort-keys toggle. Both stay on one canonical URL each; they do not replace each other.
Can JSON Minify fix trailing commas or comments?
No. The tool formats standard JSON only. Trailing commas, comments, and single quotes are rejected as invalid JSON, and the error appears next to the input rather than failing silently. If you need JSON5 or JSONC, use an editor that documents that dialect. This page stays strict so the output is safe to paste into APIs that expect RFC 8259 JSON.
What is the difference between Minify and Pretty here?
Minify (the default) collapses valid JSON to a single compact line with no extra whitespace — useful for config fields, compact logs, or API bodies. Pretty reprints with a two-space indent so you can read nested structure before you copy. Neither mode reorders array items or changes values; only whitespace and key-order preservation via JSON.stringify change.
What about very large JSON files?
The page is meant for typical API payloads. Multi-megabyte documents may strain the tab; keep large jobs on your own machine with a local CLI. There is no upload size limit because nothing is uploaded — the limit is whatever your browser can parse in memory without becoming unresponsive.
Does JSON Minify validate against a schema?
No. It only checks that the text is valid JSON and then reprints it. A green valid state means the parser accepted the document, not that the shape matches an OpenAPI or JSON Schema file. For schema checks, use a dedicated validator. This page is a minifier with a copy control.
Is there a second URL like /json-minifier/ or /minify-json/?
No. One canonical address with a trailing slash: /developer/json-minify/. We do not publish alias paths that would split the address people and search engines should share.

These tools run in your browser. Page Utils does not store, upload, or write to localStorage the keys, tokens, or text you paste. Results are a convenience aid, not legal, tax, or security advice.