{ }

JSON Formatter

Format, validate, auto-fix & inspect JSON paths

JSON & Data
πŸ”’ 100% client-side β€” your data never leaves this page
Maintained by Evanβ€’Updated: September 29, 2026β€’Reviewed: September 29, 2026
Options
Input

Chinese text and emoji are preserved by default. Enable this option to escape non-ASCII characters in pretty or minified text. Parsed values and the tree stay unchanged; UTF-8 size may increase.

Get started

Paste JSON to preview the result, then select Format JSON now to confirm validation. Advanced mode adds syntax repair, key sorting, and path lookup.

Profile: RFC 8259Pretty
Output
Output will appear here

RFC profiles only change whether top-level primitives are allowed; this is not JSON Schema validation. Numbers use JavaScript Number precision. Keep large integers as strings when exact digits matter. Non-finite results are rejected.

Input and lookup paths are not saved as browser drafts; only formatting settings are remembered. A share link contains the full input in its # fragment, without encryption. Anyone holding the link and scripts on the page can read it; do not share secrets. Legacy query links already send parameters with the first server request; they are removed from the address bar after loading.

Page reading mode

The full guide also includes pitfalls, worked examples, snippets, FAQs, and related tools for checking results or troubleshooting.

About this tool

Format or minify JSON, optionally sort object keys, inspect a tree and look up nested paths. The parser uses JavaScript numbers; keep identifiers and large exact integers in quoted strings. The RFC 4627 profile requires a top-level object or array; the other profiles accept primitive values too. These profiles do not validate a JSON Schema or application business rules. Fix JSON handles a limited set of comments, single-quoted strings, bare keys and trailing commas; uncertain repairs fail without replacing the input. Processing takes place in this page. Only display settings are saved, not your JSON or path query. Shared links contain the input in a URL fragment: anyone with the link can read it, so share examples only. Optional Unicode escaping applies to formatted and minified output. The UTF-8 byte comparison reports growth as well as savings; it is not a network-compression measurement.

Scenario Recipes

01

Repair a trailing comma without changing the message

Goal: Turn a small configuration snippet into valid JSON while preserving its string content.

  1. Paste {"message":"Hello, name: world",}.
  2. Open the additional options and run Fix JSON.
  3. The result should parse as an object whose message is still exactly Hello, name: world. Format or download it.

Result: Only the trailing comma needs removal; name: inside the string is not an object key.

Production Snippets

Special keys are data

json

{"z":1,"__proto__":{"keep":true},"a":2}

Suggested Workflow

Failure Clinic (Common Pitfalls)

Large integer identifiers change after parsing

Cause: JavaScript Number cannot represent every integer beyond 2^53βˆ’1 exactly.

Fix: Keep identifiers such as "9007199254740993" as strings or use a dedicated arbitrary-precision parser.

Frequently Asked Questions

What do the RFC profiles check?

RFC 4627 requires an object or array at the top level; the other available profiles accept primitive values. They are syntax profiles, not JSON Schema or business validation.

What can Fix JSON repair?

A limited set of comments, single-quoted strings, unquoted object keys and trailing commas. It does not evaluate JavaScript, implement all JSON5 syntax, or reconstruct missing values. Failed repairs leave the input unchanged.

Can sorting remove keys such as __proto__?

No. Key sorting preserves own JSON properties, including __proto__, constructor and prototype, and keeps array order. The formatter still uses JavaScript number semantics.

Are JSON inputs saved?

The tool saves display settings only, not the JSON input or Path Finder text. Formatting does not call a remote processing API. Copying and downloading create copies under your control.

Is a shared URL private?

No. New links put encoded input after #, which is not sent in the normal HTTP request but is readable by the recipient and page scripts. Encoding is not encryption. Old ?j= links already send their query in the first request; the page clears recognized sharing parameters after loading. Never share secrets.

How do I inspect a nested value?

Use a path such as $.orders[0].id. Exact lookup reads only properties actually present in the JSON; inherited JavaScript properties are not results.

Keep browsing