JSON Formatter & Validator
Paste JSON to beautify, minify, or validate it, with the exact line and column of any error, right in your browser.
Your JSON never leaves your browser.
Paste any JSON value, or select Load example to try the tool.
Result
Format or minify first, then copy the result or download it as a .json file.
How to format and validate JSON
-
Paste your JSON
Put any JSON value into the input area, or select Load example to try the tool.
-
Format, minify, or validate
Select Format to beautify with 2 spaces, 4 spaces, or a tab, Minify to collapse to one line, or Validate to check it. Optionally sort keys A-Z.
-
Fix errors or copy the result
If the JSON is invalid, the exact line and column are shown with a caret under the spot. Otherwise copy the output or download the .json file.
Everything runs locally in your browser. Nothing is uploaded.
Frequently asked questions
Is my JSON uploaded anywhere?
No. Formatting and validation run locally in your browser, and nothing is uploaded or sent over the network.
How does it find the error line and column?
A built-in strict JSON parser scans the text character by character and reports the exact line and column of the first problem, with a one-line snippet and a caret under the spot.
What does Sort keys A-Z do?
It recursively sorts object keys alphabetically throughout the document. The order of items inside arrays is always preserved.
Why do I sometimes get a large-number warning?
JavaScript numbers lose precision beyond about 15 significant digits. Because formatting here uses JSON.parse, such values may be rounded, so the warning flags them before you rely on the output.
Can I minify JSON and choose the indentation?
Yes. Minify collapses JSON to a single line, while Format beautifies it with 2 spaces, 4 spaces, or tab indentation.
Related tools: all tools, CSV to JSON, JSON to CSV, HTML Table to CSV, CSV to Markdown Table, Remove Duplicates CSV, CSV to SQL, and Unix Timestamp Converter.
Want tables straight from the page you are viewing, without copying HTML? LightCube Data Extractor is a free Chrome extension that does it in one click.
More guides