Free JSON Formatter
Format, validate, minify, and explore JSON data. Tree view, syntax highlighting, and one-click copy.
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.
- 1Live parse on inputJSON.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.
- 2Unsafe integer detectionBefore 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.
- 3Formatting, minifying, and key sortingJSON.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.
- 4Interactive tree viewThe 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
CSS Minifier & Beautifier
Minify CSS to reduce file size or beautify minified CSS for readability. Instant, in your browser.
CSS Beautifier
Pretty-print minified CSS with consistent indentation, or minify it. Optional alphabetical property sorting for predictable diffs.
HTML Beautifier & Minifier
Pretty-print or minify HTML with proper nesting indentation. Preserves content inside <pre>, <script>, <style> blocks.