Skip to content
BrowserUtil

JSON Formatter

Pretty-print, minify and validate JSON with clear error positions, a collapsible tree view and a local history of your last 5 documents.

Indent:

JSON input

Paste a JSON document to format it.
—
Formatted JSON appears here.
JSON output—

Document stats

Formatted JSON appears here.

Recent documents (this browser only)

The last 5 documents you formatted are kept in your browser storage. Nothing is uploaded.

Nothing saved yet — formatted documents will appear here.

How to use

  1. 1 Paste or type JSON into the editor — the result updates as you type.
  2. 2 Choose an indent, sort the keys or escape non-ASCII characters.
  3. 3 Switch between pretty-printed, minified and collapsible tree views.
  4. 4 Reopen an earlier document from the local history below.

Features

  • Pretty print with 2 spaces, 4 spaces or tabs, plus one-click minify
  • Live validation with the exact line and column of the error
  • Collapsible tree preview for large or deeply nested documents
  • Optional key sorting and non-ASCII escaping
  • Document stats: characters, bytes, depth, nodes and keys
  • Local history with your last 5 documents, stored only in your browser
  • No upload, no account — parsing runs entirely in your browser

Frequently asked questions

Is my JSON uploaded to a server?

No. Parsing and formatting run with JavaScript inside your browser tab, so your data never leaves your device.

Where is the history stored and how do I remove it?

'The last 5 documents are kept in this browser localStorage. Delete a single entry, or clear everything at once, from the history card.

Are comments or trailing commas supported?

'No. The standard JSON parser is used, so comments, trailing commas and single quotes must be removed first. The error position tells you where to look.

Does sorting keys change the data?

'Only the output order changes — values stay untouched. Sorting is applied to the formatted output, and array order is never modified.

Related tools