Skip to main content

Free JSON Formatter

Format, validate, minify, and explore JSON data. Tree view, syntax highlighting, and one-click copy.

Works offline once loaded

Common uses

  • Format API ResponsesPaste raw API JSON responses and instantly format them into readable, indented output.
  • Format JSON Config FilesClean up and validate JSON configuration files β€” package.json, tsconfig.json, settings, and more.
  • Format JSON for DebuggingUntangle minified or escaped JSON logs, error payloads, and database outputs instantly.
  • Format JSON Translation FilesValidate and prettify i18n translation JSON files (en.json, de.json) used in React, Vue, and Next.js apps.
  • Inspect and Format Webhook PayloadsPaste raw webhook payloads from Stripe, GitHub, or Shopify and read them clearly formatted.

How It Works

The formatter runs entirely in your browser using JavaScript's built-in JSON.parse and JSON.stringify β€” no library, no server. Parsing, formatting, minifying, and the interactive tree view all happen locally as you type.

  1. 1
    Live parse on input
    JSON.parse runs 200 ms after your last keystroke. If parsing fails, a hand-written error-location function reads the SyntaxError message from V8 or Firefox, extracts the line and column number, and offers a jump-to-error link in the textarea.
  2. 2
    Unsafe integer detection
    Before displaying output, the tool scans the raw source for integer literals of 16 or more digits (ignoring those inside quoted strings), then tests each with Number.isSafeInteger. If any would be silently rounded by IEEE-754 double storage, a warning appears before you copy or download.
  3. 3
    Formatting, minifying, and key sorting
    JSON.stringify(value, null, indent) produces the formatted or minified output. When sort keys is on, a recursive function walks every object in the parsed tree and rebuilds it with Object.keys(...).sort() before serialization β€” arrays are left in their original order.
  4. 4
    Interactive tree view
    The tree view is a hand-written recursive flatten that converts the parsed object into a flat list of nodes with depth, path, and expand/collapse state. Rendering is capped at 5,000 visible nodes to prevent the tab from freezing on multi-megabyte documents with large expanded arrays.

Everything runs locally in your browser β€” your JSON is never sent to any server.

Related Tools

Frequently Asked Questions