Skip to content

JSON Toolkit

JSON Formatter. Validate, losslessly format, and minify JSON while flagging duplicate members and precision-sensitive numbers before parsed tree or XML views.

Use this result well

Inputs that matter
JSON text, the indentation choice, optional key sorting and the Auto format setting.
Output to expect
A formatted or minified JSON result, parsing feedback and an expandable tree for inspecting values.
How it works
Format adds indentation; Minify removes optional whitespace. Auto format refreshes the formatted result when you edit the input.
  • Review duplicate-key and number-precision warnings before using a parsed tree or XML conversion. Formatting and minifying preserve the original tokens.
  • Keep a copy of the original before using Repair JSON. Syntax validation does not check your application’s schema or business rules.

Choose your path

Built around the job you need to finish

Validate, format or minify one JSON text without silently changing duplicate members or precision-sensitive number lexemes, while clearly separating parsed convenience views from lossless evidence.

API developer inspecting a production payload

Make a large response readable without changing identifiers, decimals or duplicate-member evidence.

Paste or load the bounded payload, validate it, inspect interoperability warnings, format losslessly and save the exact result to the API record.

Can diff input/output and prove that whitespace changed while number lexemes and duplicate members did not.

Data or security reviewer investigating an ambiguous payload

See duplicate names, unsafe integer/precision risks and parser limitations before approving a contract.

Validate adversarial and boundary samples, compare lossless text with parsed tree/XML views, and keep warnings in the Project record.

Does not mistake JSON.parse last-member behavior or IEEE-754 conversion for the sender’s exact data.

Keyboard, screen-reader or narrow-screen user

Operate validation, formatting, copying, download and Project save with named controls and contained editors.

Navigate labels/actions, read errors and warnings, then copy or save the result without relying on color alone.

Completes the exact task with no unnamed control, cropped editor or ambiguous status.

Was this tool helpful?

Reference & details

How it works

Formatting Rules

The default formatter tokenizes valid JSON and changes whitespace only, preserving string and number lexemes, member order, and duplicate members. Key sorting is skipped when duplicate names or precision-sensitive numbers are present.

Validation

The formatter validates JSON against RFC 8259 standard. It detects common issues like trailing commas, single quotes, unquoted keys, and comments (which are not valid JSON).

Source: IETF RFC 8259

Minification

Lossless minification removes insignificant JSON whitespace while preserving every string, number token, member, and array item. It does not certify a payload contract, canonicalize JSON, or make ambiguous duplicate members interoperable.

Updated: July 2026

Example Scenarios

Paste a minified API response to see its structure clearly. Useful when debugging REST APIs or inspecting network responses.

Formatted, indented JSON with syntax highlighting

Format a messy package.json or tsconfig.json with consistent indentation before committing to version control.

Clean, readable config with 2-space indentation

A developer receives a compressed JSON webhook body from Stripe or GitHub and formats it to trace nested event fields.

Expanded tree with clear key-value hierarchy for debugging

Common Mistakes to Avoid

Using single quotes in JSON (valid in JavaScript but not in JSON)

JSON requires double quotes for all strings and keys. Use: {"key": "value"} not {'key': 'value'}

Including trailing commas after the last item in arrays or objects

JSON does not allow trailing commas. Remove the comma after the last element: [1, 2, 3] not [1, 2, 3,]

FAQ

JSON is a strict data format: double quotes only, no comments, no trailing commas, and no functions. JavaScript object literals are more permissive. Valid JSON is always valid in JavaScript, but not vice versa.

Common causes include single quotes instead of double quotes, trailing commas, unquoted keys, comments, or unescaped special characters in strings. The formatter highlights the error location to help you fix it quickly.

The formatter runs in the loaded browser page and keeps drafts in browser-local storage for convenience. That is not a guarantee that a device, extension, clipboard, downloaded file, or Project record is appropriate for secrets; redact credentials and personal data first.

Yes. Use the minify option to remove whitespace and reduce file size for production APIs and network transfers. Minified JSON is functionally identical but harder to read — format again when debugging.

RFC 8259 states that names within an object should be unique, but parsers often accept duplicates and use the last value. Avoid duplicate keys in production data — behavior varies across languages and can cause subtle bugs.

About JSON Formatter

Validate and reformat JSON without silently normalizing exact number tokens or discarding duplicate object members. Parsed tree, key sorting, and XML remain convenience views with explicit interoperability boundaries.