JSON Formatter

Check duplicate JSON keys before minifying or exporting. Format API payloads locally while preserving large IDs, decimal spelling and string escapes.

JSON Formatter

Check duplicate keys before minifying; keep number text unchanged.

Input is autosaved in this browser’s local storage. Reset clears the saved input. Avoid production secrets. Formatting preserves number text and string escapes; it does not repair invalid JSON.

Valid JSON
{
  "request_id": "000123",
  "items": [
    {
      "sku": "00123",
      "quantity": 2
    }
  ],
  "active": true
}
Steps

How to use

  1. Paste JSON or load a workflow example.
  2. Resolve syntax errors and duplicate object keys in the source.
  3. Format, minify or sort keys, then copy or download the output.
Examples and use cases
  • Format a messy API response for debugging.
  • Minify JSON for smaller file sizes.
Privacy, limits and tool details

Key facts

Processing method
A bounded structural scanner checks decoded member names and retains original number and string tokens for formatting and export.
Privacy model
JSON processing runs locally. Input is autosaved in local browser storage until Reset clears it. Avoid production secrets.
Privacy

Privacy and processing

Processing method: A bounded structural scanner checks decoded member names and retains original number and string tokens for formatting and export.

Privacy model: JSON processing runs locally. Input is autosaved in local browser storage until Reset clears it. Avoid production secrets.

Tips

Pro tips

  • Wrap JSON in a code editor with syntax highlighting for teams.
  • Keys should be double-quoted — the validator catches single-quoted keys.
Watch out

Common mistakes to avoid

  • Pasting JSON with trailing commas — not valid.
  • Comments in JSON are not standard — use JSONC / JSON5 tooling.
Detailed JSON Formatter guide

Check duplicate JSON keys before minifying

Select Load duplicate-key example:

{
  "event": {
    "status": "pending",
    "status": "paid"
  }
}

Both status members belong to the same object. Ordinary JavaScript parsing keeps only the last value; formatting that parsed result can hide the original conflict. ToolMint inspects source members first and blocks formatting, sorting, tree view, copy and download while duplicates remain. It does not decide whether pending or paid is correct. Check the originating API or application, then remove the incorrect member or give distinct fields distinct names.

The same key in separate objects is not a duplicate. Escaped names are compared after decoding: "status" and "\u0073tatus" identify the same member name. Matching is case-sensitive; "Status" and "status" differ. No Unicode normalization is applied.

Format large IDs without rounding their digits

Select Load number example:

{"event_id":9007199254740993,"amount":1.2300,"scale":1e3,"zero":-0}

Formatted and minified output retain these number tokens exactly, including trailing decimal zeros, exponent spelling and negative zero. Strings retain their source escape spelling. Formatting changes whitespace outside strings; Sort keys additionally changes object-member order using decoded key names, while retaining array order. Numeric-looking keys are compared as strings, so "10" sorts before "2".

This is text preservation, not arbitrary-precision arithmetic. A downstream JavaScript consumer can still round the bare event_id number. If an API contract permits string IDs, obtain the identifier as a string at its source. Quoting a value after another system already rounded it cannot restore its digits.

Tree preview uses JavaScript values. It is disabled when a number token would change spelling during JavaScript serialization, such as the example above. Use formatted or minified output to inspect those numbers. This conservative check also disables the tree for ordinary exponent notation or decimal trailing zeros.

Inspect an API response

  1. Select Load API example or paste JSON into JSON input.
  2. Resolve syntax errors and duplicate keys in the source.
  3. Use Beautify, Minify, or the output tabs. Copy or download the displayed output.
  4. For compatible inputs, open Tree and search keys or values. Use Sort keys only when changing member order is intended.

The formatter accepts standard JSON, including top-level strings, numbers, booleans and null. Trailing commas, comments and single quotes are rejected. It does not automatically repair a payload. Syntax validity is separate from a data contract: use JSON Schema Validator to check required fields and types, or JSONPath Tester to select values.

For malformed input, use JSON Repair to inspect a proposed correction and its changes. Repair retains the original, blocks unresolved duplicate-member conflicts and requires review of repaired data before export; it cannot recover missing information.

Privacy and practical limits

Processing runs locally without uploading JSON content. Input is autosaved in browser local storage, so it may persist after the tab closes. Reset clears the saved input. Avoid production secrets and use an appropriate device; browser storage is not a secure secret vault.

Input is limited to 1,048,576 JavaScript string code units, 100 nesting levels and 100,000 values. Generated output is limited to 8,388,608 code units. These are character limits, not a promise to handle every file of a given byte size. The line gutter displays the first 30 lines; use the reported line and column to locate errors beyond that gutter. Larger or complex data belongs in a suitable local editor.

Formatting does not validate business rules, repair corrupted IDs, or produce a cryptographic canonical form. Browser resource limits reduce workload but do not guarantee performance on every device.

To compare two valid documents by structure and values, use JSON Diff. It ignores object key order, keeps arrays positional and reports paths without rounding large IDs.

Sources

Frequently asked questions

Yes. Invalid JSON returns an error with the reason.

Yes, after syntax errors and duplicate keys are resolved. Formatting and minification preserve source number and string tokens.

No. Duplicate decoded member names within the same object block formatting, sorting and export. Correct the source after checking which value is intended.

Formatted and minified output preserve number tokens as text. Downstream JavaScript parsing can still round large numbers; tree preview is disabled when number spelling would change.

Input is autosaved in local browser storage. Reset clears the saved input. JSON content is not uploaded; avoid production secrets.
5 min read