JSON Formatter

Format and validate JSON while preserving large integers.

  • Runs locally in your browser
  • No upload required

Capabilities

  • Keyboard shortcuts
  • Drag and drop
  • Local file intake
  • Download result
  • Advanced options

Try it

Compare with JSON
or drop a .json file here.

Off by default. When on, the document is stored only on this device and Clear removes it.

{
  "orderId": 9007199254740993,
  "enabled": true
}

Supported formats

Input
text, file
Output
text, json
Files
Local file intake and drag/drop

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

Paste JSON to format, minify, or validate it. The tool scans the document without converting number literals, so large integers keep their exact value and malformed input is reported instead of silently changed.

How it works

  • A purpose-built scanner tokenizes the document without turning number literals into JavaScript numbers.
  • The structure is checked for trailing content, duplicate keys, and syntax errors before anything is reformatted.
  • Format re-emits the tokens with your chosen indentation; Minify removes all optional whitespace.

Methodology

  1. Tokenize the JSON document in a single pass, keeping number literals as text so no value is rounded.
  2. Validate the token stream against the JSON grammar of RFC 8259 and ECMA-404 before any transformation.
  3. Re-emit the original tokens with the requested indentation, or strip optional whitespace for minification.

Usage

  1. Paste or type a JSON document.
  2. Choose format or minify, and set an indentation size for format.
  3. Review the result or the positioned error before copying or downloading.

Examples

Large integer preserved

jsonSelect to copy
{"orderId":9007199254740993,"enabled":true}

Limitations

Why JSON formatting is not just whitespace

Formatting JSON is a review aid: consistent indentation makes diffs readable and exposes structural mistakes. It becomes unsafe when the formatter parses numbers through JavaScript numbers, because identifiers such as order ids and high-precision decimals then change value without warning.

This tool scans the document, validates its structure, and re-emits the original literals, so what you see is what was there.

Frequently asked questions

Is my input sent to a server?
No. The tool is designed to run in the page; nothing is uploaded by this static page.

Sources

  1. RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format — IETF (accessed 2026-09-01)