Destination Dazzle
#json#developer tools#local processing

Format and Minify JSON: A Reproducible Example

Try a valid JSON object, reproduce the formatted output, then test a trailing comma, Unicode byte count and precision limitations in the local formatter.

James Oct 15, 2026 2 min read

This walkthrough uses synthetic data that you can paste into the JSON Formatter. The expected outputs are covered by local regression tests. It is not a benchmark of every browser or a promise that parsing preserves every original byte.

1. Paste a compact object

{"name":"Ada","items":[1,2],"active":true}

Choose Format. The tool uses two-space indentation:

{
  "name": "Ada",
  "items": [
    1,
    2
  ],
  "active": true
}

Whitespace has changed, but the parsed values remain the same. Choose Minify and the output returns to the compact version. The tool does not sort object properties or provide a structural diff.

2. Introduce a syntax error

Try a trailing comma:

{"name":"Ada",}

The parser rejects it. The output is cleared so a previous successful result cannot be mistaken for the new result. The exact error wording and reported location depend on the browser. JSON also requires double-quoted property names and does not allow JavaScript comments.

Fix one problem at a time. A syntactically valid result still may not contain the fields or types that your application requires; that is schema or application validation, which this tool does not perform.

3. Understand the byte count

For {"label":"é"}, the minified JSON takes 14 UTF-8 bytes: the accented character takes two bytes. Counting JavaScript string units would incorrectly report 13. The formatter reports the encoded minified size, not the formatted pane's character count or an HTTP compressed transfer size.

4. Keep precision-sensitive originals

JavaScript's ordinary JSON parser represents numbers using its number type. Very large integers can be rounded, and duplicate property names can collapse to a single value. Reformatting is therefore not a safe way to preserve a signed payload or audit the exact bytes of a received document.

For identifiers that an application defines as strings, keep them quoted. Do not change a numeric field to a string without checking that application's schema.

5. Clear and copy deliberately

Use Copy after checking the output, and Clear to empty the tool's input and output. Clearing the tool does not clear your system clipboard. Parsing runs locally, while the surrounding site can still make the asset and analytics requests described in the privacy policy.

Reference for JSON syntax and interoperability: RFC 8259.

Next post Why a PDF May Not Shrink: Check the Document Before Retrying Not all PDF size reductions use the same method. Re-saving document structure is different from reducing scan resolution or re-encoding…