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
Supported formats
Privacy
Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.
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
- Tokenize the JSON document in a single pass, keeping number literals as text so no value is rounded.
- Validate the token stream against the JSON grammar of RFC 8259 and ECMA-404 before any transformation.
- Re-emit the original tokens with the requested indentation, or strip optional whitespace for minification.
Usage
- Paste or type a JSON document.
- Choose format or minify, and set an indentation size for format.
- Review the result or the positioned error before copying or downloading.
Examples
Large integer preserved
{"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
- RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format — IETF (accessed 2026-09-01)
Send feedback
Tell us if this tool helped, report a problem, or suggest a tool. Only the message you type is sent — never the input you used in the tool.
Was this tool useful?
Prefer to write to us directly? See the contact page.