Free · Fast · Privacy-first

Format Minified JSON, Single Line to Readable

Build tools, API responses, and database exports produce minified JSON to save space.

Expands single-line JSON to full indented format

🔒

Works with any minified JSON from any source

Syntax highlights keys, values, and types

No size limits for typical use cases

Cost
Free forever
Sign-up
Not required
Processing
In your browser
Privacy
Files stay local
FreeNo signupWhite-label

Add this JSON Formatter to your website

Drop the JSON Formatter into any page — blog post, product docs, intranet, school portal — with a single line of HTML. Your visitors get the full tool, processed entirely in their browser. No backend, no uploads, no signup.

  • Files stay 100% in the visitor's browser
  • Responsive — adapts to any container width
  • Free forever, no API key needed

Embed code

<iframe
  src="https://www.fixtools.io/json/json-formatter?embed=1"
  width="100%"
  height="780"
  frameborder="0"
  style="border:0;border-radius:16px;max-width:900px;"
  title="JSON Formatter by FixTools"
  loading="lazy"
  allow="clipboard-write"
></iframe>

Attribution-friendly: a small "Powered by FixTools" link appears in the embed footer.

What Minification Does to JSON and Why Expanding It Matters

JSON minification removes all whitespace characters that are not inside string values: spaces after colons and commas, newlines between key-value pairs, and the indentation at every nesting level. The resulting text is a single line with no spaces except inside string values themselves. For a simple object like {"name": "Alice", "age": 30}, the minified form is {"name":"Alice","age":30}, saving seven characters. For a deeply nested API response with hundreds of fields, minification can reduce size by 20 to 50 percent. Build tools like webpack and rollup minify JSON assets for this bandwidth saving, and production APIs return minified JSON by default for the same reason.

RFC 8259 defines whitespace in JSON as insignificant between tokens. Minification exploits this definition: removing whitespace produces a document that any compliant JSON parser reads identically to the formatted version. The parser sees the same tokens in the same order and produces the same data structure; it simply has fewer whitespace characters to skip. This is why minification has zero effect on parsed data and why expanding minified JSON with a formatter accurately restores the original structure. The output of expanding minified JSON is byte-for-byte equivalent in parsed meaning to the original.

Expanding minified JSON provides two practical benefits beyond basic readability. First, it enables effective searching: finding a key named "userId" in 10,000 characters of single-line JSON requires a find-in-page search through a wall of compressed text. In formatted JSON, each key is on its own line and the nesting depth is visually clear. Second, it enables meaningful comparison: two minified JSON documents that differ in one field look nearly identical as single lines, while formatted versions expose the difference at the correct indentation level immediately, making it easy to spot added, removed, or changed fields.

Minified JSON also makes certain spec edge cases nearly invisible. A trailing comma left over from a hand edit may sit at position 8,500 of a single line where no parser error highlight will help you find it visually. Duplicate keys, which RFC 8259 permits but most parsers handle by keeping the last value, are easy to miss in a compressed line where the same key may appear hundreds of characters apart. Unicode escape sequences like \u200B (zero-width space) inside string values can look identical to neighbouring characters in minified text but cause string comparisons to fail. Expanding the JSON puts each key on its own line, surfacing duplicates immediately, and isolates each string value so invisible Unicode characters become apparent when the value does not match what the eye expects.

Expanding minified JSON also clarifies how key ordering interacts with downstream tools. JavaScript and Python preserve insertion order in modern runtimes, so minified output from those languages typically reflects the order fields were assigned. Go encoding/json sorts map keys alphabetically by default, which means a minified Go-produced JSON document will have keys in a different order than the same data minified from Python even though the data is identical. Expanding both reveals the alphabetical layout for the Go output and the insertion order for the Python output, which is critical when comparing exports from a mixed-language stack. Tools like canonical JSON or the npm package json-stable-stringify enforce alphabetical order on output regardless of source language, producing byte-identical output across languages for cryptographic hashing or deterministic diffing.

How to use this tool

💡

Paste your minified single-line JSON here. Click Format to expand it to a fully indented, readable structure.

How It Works

Step-by-step guide to format minified json, single line to readable:

  1. 1

    Copy the minified JSON

    Copy the single-line or compressed JSON from your source: an API response body, a build output asset, a log file entry, or a database field value. If the JSON is inside a larger text document, identify the start of the JSON by finding the first opening brace or bracket and copy from that character to the matching closing character.

  2. 2

    Paste into FixTools

    Open FixTools in your browser and paste the minified JSON string directly into the JSON Formatter input area. The input accepts a raw JSON string of any length. If the content begins and ends correctly with matching braces or brackets, the formatter can process it regardless of how compressed or dense the content is.

  3. 3

    Click Format

    Click the Format button. The formatter validates the JSON using the browser's native parser, then re-serializes it with full indentation and syntax highlighting. The output expands from a single dense line into a multi-line structure with each key on its own indented line. For a 10,000-character single-line object, the expanded output may run to several hundred readable lines.

  4. 4

    Read or copy

    Scroll through the expanded output to understand the data structure, then copy it using the Copy button for use in documentation, a code comment, or a debugging session. Use Ctrl+F or Cmd+F in your browser to search for specific key names in the formatted output without scrolling manually through every line.

Real-world examples

Common situations where this approach makes a real difference:

Webpack developer

Build tool JSON assets are almost always minified in production but need to be readable for maintenance.

Operations engineer

Structured log payloads are minified for aggregation efficiency but need expansion for human reading.

Mobile developer

Understanding a minified data file's full schema before writing a parser prevents access path errors.

Code reviewer

Formatting minified files before diffing makes code reviews of JSON changes practical and reliable.

Pro tips

Get better results with these expert suggestions:

1

Minify JSON for production, format for development

Use formatted JSON in version-controlled config files so pull request diffs are readable and code reviews are meaningful. Use minified JSON in production API responses and build assets to reduce payload size and bandwidth costs. Maintain a single formatted source file and generate the minified version as part of your build process rather than committing both forms, which would create maintenance burden and confusing diffs.

2

Use jq to expand minified JSON in a terminal

In a terminal, the command jq . file.json or echo '{"a":1}' | jq . expands and pretty prints minified JSON. jq is available on macOS via Homebrew (brew install jq), on Linux via apt or yum, and on Windows via winget. It is faster than switching to a browser for command-line workflows and also supports field extraction and transformation for more complex operations.

3

Check that minification did not corrupt the JSON

Some minifiers have edge-case bugs that produce invalid JSON, such as incorrectly removing spaces from inside string values that contain whitespace sequences. If a minified file produces unexpected parse errors or behaves differently than the original, expand it in FixTools and validate it to confirm the minified form is still syntactically correct RFC 8259 JSON before assuming the problem is elsewhere.

4

Avoid committing minified JSON to source control

Minified JSON makes pull request reviews nearly impossible because every line in the file appears as changed whenever the data is updated. Commit the formatted version and add a build step to generate the minified version as a build artifact. This keeps your git history readable, your diffs focused on actual data changes, and your code reviews productive rather than filled with whitespace noise.

FAQ

Frequently asked questions

Minified JSON is a JSON document with all insignificant whitespace removed: no spaces after colons or commas, no newlines between key-value pairs, and no indentation. The result is a single-line string that is fully valid JSON and parses identically to the formatted version. Minification reduces file size by eliminating characters that JSON parsers skip over, improving transmission speed and reducing storage and bandwidth costs for APIs and web applications that serve large volumes of requests.
Paste the minified JSON into FixTools and click Format. The formatter parses the minified string and re-serializes it with your chosen indentation (2 spaces, 4 spaces, or tabs). Alternatively, use JSON.stringify(JSON.parse(minifiedJson), null, 2) in any JavaScript environment to get a formatted string. In a terminal with Python installed, run python3 -m json.tool with a file argument or piped input. In a terminal with jq, run jq . file.json to format to stdout.
No. Expanding minified JSON only adds whitespace characters. The JSON specification defines whitespace as insignificant between tokens. Any JSON parser reading the expanded version and the minified version of the same document produces an identical data structure in memory. The data values, key names, array contents, object ordering, and all nested structures remain exactly the same. You can verify this by checking that JSON.parse(minified) and JSON.parse(expanded) return deeply equal results.
Minified JSON reduces payload size, which directly reduces bandwidth usage and can improve response times for clients on slow connections. For high-traffic APIs serving millions of requests per day, the cumulative bandwidth saving from minification is significant. Some APIs respect the Accept-Encoding: gzip request header and compress the response body, which reduces the size benefit of minification since gzip compresses whitespace efficiently. Many APIs still default to uncompressed minified responses because gzip handling adds server-side CPU cost.
Several options exist. The jq tool: jq . file.json or echo '{"a":1}' | jq . formats JSON with 2-space indentation by default. Python: python3 -m json.tool file.json uses the built-in JSON module (4-space default). Node.js: node -e "console.log(JSON.stringify(JSON.parse(require('fs').readFileSync('file.json','utf8')), null, 2))" reads and formats a file. All three write to stdout, which you can redirect to a new file with > output.json.
Use FixTools Minify JSON at fixtools.io/json/minify-json to compress formatted JSON back to a single line. Alternatively, in JavaScript use JSON.stringify(JSON.parse(json)) without a space argument. In Python, use json.dumps(data, separators=(",", ":")) which removes all non-essential whitespace including spaces after separators. In a terminal with jq, run jq -c . file.json where the -c flag produces compact single-line output.
There is no hard limit imposed by FixTools. The practical limit is your browser's available memory and the JavaScript engine's internal string length limit (around 2GB in V8). Files up to 10 to 20 megabytes format and display quickly in most modern browsers. Files between 20MB and 100MB may parse quickly but be slow to render because the browser must create syntax-highlighted DOM elements for the full output. For files over 100MB, jq in a terminal is more efficient.
If the minified JSON has been double-serialized (converted to a JSON string and embedded as a string value inside another JSON document), you will see escaped quotes and backslashes in the value. First format the outer JSON document to identify the string value containing the nested JSON. Copy the string value, remove the surrounding outer quotes, and unescape the backslashes (replace \" with " and \\ with \). Paste the resulting inner JSON string into FixTools for a second format pass to see the nested structure.
Three causes account for most cross-language drift. Floating point precision differs: 0.1 + 0.2 in JavaScript is 0.30000000000000004, and round-tripping that value through JSON.stringify and Python json.loads preserves the same float, but if the original Python source stored Decimal("0.3"), the JSON serialiser converted it to 0.3 and lost the precision marker. Integer width is the second: JavaScript uses 64-bit floats so integers beyond 2^53 - 1 lose precision, while Python and Go use arbitrary or 64-bit integers. The third is key ordering: V8 and Python 3.7+ preserve insertion order but Go encoding/json sorts map keys alphabetically. Expanding the JSON reveals these structural facts so you can pick the right downstream parser.
Gzip and brotli compress repeated patterns including whitespace very efficiently, so the network-level size difference between minified and pretty-printed JSON shrinks dramatically once compression is applied. A 100KB pretty-printed payload may compress to 12KB while the equivalent 70KB minified version compresses to 11KB, a 1KB difference that rarely justifies the readability loss. Modern APIs that serve gzip or brotli-encoded responses can often serve pretty-printed JSON with negligible bandwidth cost. The cases where minification still matters are uncompressed transports, embedded systems where the JSON is parsed before decompression, and database storage where the raw bytes count. For typical HTTPS APIs, compression handles most of the size concern minification was invented to address. Measure end-to-end response size in your specific stack before optimising; the ratio between minified and pretty-printed often surprises teams who assume the wire-level difference is large.

Ready to get started?

Open the full JSON Formatter — free, no account needed, works on any device.

Open JSON Formatter →

Free · No account needed · Works on any device