FREE · DEVELOPER TOOLS
JSON Formatter.
Format, validate, minify and explore JSON with exact error positions, automatic repair, key sorting and a collapsible tree view.
✓ Valid JSON · 316 bytes · 13 keys · 5 objects · 1 arrays · depth 4
Large numbers are kept exactly as written (they exceed JavaScript’s safe integer range).
Formatting works on the original text, so key order and every digit are preserved; validation follows the strict JSON standard (RFC 8259). Nothing is uploaded.
Steps to use JSON Formatter
Paste JSON or open a .json file. The result is validated and formatted as you type; choose 2 or 4 spaces, tabs or minify, optionally sort keys, and switch to the tree view. If the JSON is invalid, read the exact position or click “Try to repair automatically”.
How JSON Formatter processes your input
Strict RFC 8259 validator with precise line/column errors and plain-language explanations (trailing commas, single quotes, comments, missing commas), automatic repair of common mistakes, lossless re-indentation, minification, key sorting, statistics (size, keys, objects, arrays, depth), a collapsible tree, copy and .json download.
JSON Formatter: worked example
{"a":1,"b":[1,2]} → formatted with 2 spaces; a missing comma is reported as “line 3, column 2: a comma is probably missing” with the line shown.
Format and validate JSON
- Paste JSON or open a .json file (up to 20 MB). It is validated and formatted as you type.
- Choose 2 spaces, 4 spaces, tabs or minified output. Sort the keys if you want, or switch to the collapsible tree view.
- If the JSON is invalid, read the exact line and column of the error with a plain-language explanation, or use the automatic repair.
- Copy the result or download it as a .json file.
Example: a missing comma is reported as “line 3, column 2: a comma is probably missing”, with the line shown. The repair fixes common mistakes such as trailing commas, single quotes and comments.
Why the output can be trusted
- Validation follows the strict JSON standard (RFC 8259).
- Re-indenting keeps the original key order and every digit, including integers larger than JavaScript can represent. Only key sorting re-parses the data.
- Statistics show the size, number of keys, objects and arrays, and the nesting depth. The tree view shows up to 4,000 nodes.
- Your JSON never leaves the browser. To compare two documents, use JSON compare; to convert to YAML, use the JSON to YAML converter.
Questions about JSON Formatter
Can it fix broken JSON?
Often yes. The automatic repair handles common mistakes such as trailing commas, single quotes, comments and missing commas. Always check the result.
Will it change my large numbers?
No. Formatting keeps every digit, even for integers too large for JavaScript. Only sorting keys re-parses the data.
Is my JSON uploaded?
No. Validation and formatting run entirely in your browser.
Is JSON Formatter free, and do I need an account?
Yes. This tool is free to use in your browser without an account. Processing takes place on your device.
What are the limits and what should I check?
Files up to 20 MB. Formatting keeps the original key order and every digit, including integers larger than JavaScript can represent; sorting keys re-parses the data. The tree view shows up to 4,000 nodes. Review the result before using it in your work.
Is my input sent to a server?
Your input is processed in your browser and is not uploaded by this tool. Files and pasted text are cleared when the page is refreshed. Normal website requests are still required to load the page and its libraries. Read the privacy explanation.