JSON Minify
To minify JSON online, paste an object, array, or API response — or press Load example. Choose Minify (default, one compact line) or Pretty (two-space indent). Invalid JSON — trailing commas, comments, single quotes — shows an error beside the input. Read the input and output character counts, then Copy or Clear. Nothing is uploaded.
Updated
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.
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. Minifying markup instead? Use HTML Minifier.
How does the JSON Minify work?
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. Parse locally
The browser's JSON.parse runs in this tab to check the text. Invalid JSON (trailing commas, comments, single quotes) gets an error next to the input; valid JSON is then reprinted from your original text, so numbers and escapes are copied exactly. We do not send the blob anywhere.
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. 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. Validation and formatting run in the browser. 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. Both modes change only whitespace outside strings: keys stay in order, duplicate keys are kept as written, and array items are never reordered.
- Will JSON Minify round big numbers like 64-bit IDs?
- No. JSON.parse only checks that the text is valid; the output is rebuilt from your original characters. A large ID such as 12345678901234567890 stays 12345678901234567890 instead of becoming 12345678901234567000, and spellings like 1.50, 1E5, or \u00e9 escapes are copied as typed. A plain JSON.parse / JSON.stringify round trip would round or rewrite them.
- 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.
What else can I open?
- JWT Token DecryptDecrypt a compact JWE locally with Web Crypto.
- CSS FormatterPretty-print or minify CSS locally in the browser.
- SQL FormatterPretty-print SQL queries locally — does not execute SQL.
- JSON ViewerExplore JSON as a collapsible tree with search and copyable JSONPath, in the browser.
- JSON Schema GeneratorGenerate a JSON Schema from a JSON sample in the browser — no upload.
- YAML FormatterPretty-print and validate YAML in the browser — keeps YAML as YAML, nothing uploaded.
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.