HCODX/JSON Minifier
100% browser-based · No data leaves your device

JSON Minifier

Minify JSON in your browser. Strip whitespace, newlines, and indentation to produce the smallest valid JSON. Lossless — only formatting changes; parses back to the same data. Strict RFC 8259, all-local.

JSON input
Minified output
Format options
Open in validator
Input size
0 B
Output size
0 B
Output lines
0
Status
Ready
Example

Pretty in, compact out

Same data, smallest valid payload. Minify strips every space and newline that isn't required by the syntax.

Pretty JSON
{
  "name": "hcodx",
  "items": [1, 2, 3]
}
Minified
{"name":"hcodx","items":[1,2,3]}
Use cases

What you'll use this for

Anywhere unreadable JSON shows up — API responses, log lines, copy-pasted config, compressed payloads.

API response inspection

Paste a minified response, see the structure as you'd want to read it in a doc.

Log entries

Tail a log, find a JSON line, beautify it to make sense of the fields.

Code review

Expand a fixture file so the diff highlights real changes, not whitespace.

Documentation

Paste an example response into docs with consistent indentation.

Step by step

How to beautify JSON

1

Paste your JSON

Drop it into the left editor. Compact, single-line JSON works fine.

2

Pick indent

2 spaces by default. Switch to 4 spaces or tab to match your project style.

3

Click Beautify

Or leave auto-format on for live updates. Runs locally with JSON.parse + JSON.stringify.

4

Copy or download

Copy to clipboard, save as .json, or flip the Mode to Minify to compress back.

FAQ

Frequently asked questions

Smaller payload size — important for HTTP APIs, browser caches, and disk storage. Minification typically cuts JSON size 30–60% depending on how indented the source was.

Yes. Only whitespace is removed; values, key order, and types are preserved. The output parses back to the same data as the input.

Yes. Free, no signup, no ads, no rate limits.

No. Pure client-side. Uses the browser's built-in JSON.parse; your data never leaves your device.

Strict JSON only here. For JSON5 (comments, unquoted keys, trailing commas) use the JSON5 formatter.

About

About this beautifier

JSON beautification is a one-pass operation: parse the input into a JS object, then serialize it again with explicit indentation. The result is canonical — same structure regardless of whether the input was minified, prettified, or hand-typed.

What it does

  • Indents at 2 spaces (default), 4 spaces, or tab.
  • One key per line in objects, one item per line in arrays.
  • Quotes stay " (double); single-quoted input fails per RFC 8259.
  • Optional sort alphabetizes keys recursively (toggle).
  • Minify mode flips to compact output (no whitespace).

What it doesn't do

  • Comments. Strict JSON has no comments. Use the JSON5 formatter for those.
  • Lossy edits. No type coercion, no key removal. The output parses back to the same object as the input.
  • Schema validation. Syntactic only — use the JSON validator for structural checks against a schema.
Related

Related tools