Code · Made a little simpler

JSON formatter

Validate strict JSON, format indentation, minify or recursively sort object keys without changing numeric or string literals. Browse a collapsible tree, search keys, values, and JSON pointers, and get precise errors and duplicate-key warnings.

Free to useNo account neededProcessed on your device
Your workspaceProcessed on your device

Undo: Ctrl/Cmd+Z · Redo: Ctrl/Cmd+Shift+Z or Ctrl+Y. Up to 20 steps and 4 million retained characters in this tab. Clear discards history.

Sorting changes object key order recursively; array order and duplicate-key order are preserved. Keys use UTF-16 order.

Add this tool to your website

Paste this code into your page to add the tool and a visible ToolMellow credit link.

HTML embed code
Preview embed

JSON formatter: how to use it

  1. Paste a JSON document or load a local text file.
  2. Choose Format or Minify.
  3. Review validation messages, then copy or download the result.

Limits and notes

Strict JSON only: comments and trailing commas are rejected. Optional key sorting compares decoded keys in UTF-16 order recursively; arrays and identical-key order are preserved. Formatting preserves the source spelling of numbers and strings. Duplicate keys are flagged, not removed. Limit: 1 million characters and 256 nesting levels. Tree view supports up to 10,000 syntax nodes and 2 million characters of paths and values, and displays children in groups of 100. Larger documents still produce a full formatted result.

How your privacy works →

JSON formatter: common questions

Are large integers preserved?

Yes. Formatting operates on source tokens instead of converting numbers to JavaScript Number values. A literal such as 9007199254740993 is kept as written.

Will invalid JSON be repaired automatically?

No. A validation message identifies the problem. Your original text stays intact so you can decide how to fix it.

Does this accept comments, trailing commas, or JSON Lines?

No. Comments, trailing commas and extra records are rejected. Each operation needs one complete strict JSON value. This is not a JSON5, JSONC or NDJSON conversion or repair tool.

Does a successful format validate a JSON Schema?

No. Success checks accepted JSON syntax. It does not verify required fields, application types, cross-field rules or a JSON Schema. Validate those requirements separately in the receiving system.

Tool guides