JSON Formatter
Format, validate and minify JSON: 2 spaces, 4 spaces or tabs, sort keys, see the exact line and column of errors, fix trailing commas and quotes, copy or download.
Format, validate and minify JSON: 2 spaces, 4 spaces or tabs, sort keys, see the exact line and column of errors, fix trailing commas and quotes, copy or download.
About this tool
JSON Formatter makes JSON readable and tells you exactly what is wrong when it is not valid. Paste JSON into the box, or press Try an example. If it is valid, you see it formatted straight away, with a green “Valid JSON” label, the number of keys, how deeply it is nested, and the size before and after. Choose the indentation: 2 spaces, 4 spaces or tabs. Tick Sort keys A–Z to order every object’s keys alphabetically, which makes two versions of the same data easy to compare. Press Minify to remove all spaces and line breaks for the smallest possible file, for example before putting JSON into a config value or an API request. If the JSON is not valid, the message shows the line and column of the problem, the line itself and a caret under the spot, along with the browser’s explanation. Many errors come from JavaScript habits that JSON does not allow: trailing commas, single quotes, keys without quotes and comments. Try to fix repairs these automatically and checks the result again; always look at the fixed JSON before using it. Copy the result with one button or download it as a .json file. Full screen gives you more room for large files. Everything runs in your browser, so API responses, tokens and private data never leave your device.

Or press Try an example.
2 spaces, 4 spaces or tabs; sort keys if you like.
Line, column and the exact spot, with a one-click fix.
Copy the result or save a .json file.
Line, column and a caret under the problem.
Trailing commas, single quotes, unquoted keys, comments.
2 spaces, 4 spaces or tabs, or minified.
Alphabetical keys at every level.
Keys, nesting depth and size before and after.
Runs in your browser; nothing is sent anywhere.
Read it, fix it, ship it
Turn a one-line response into readable, indented JSON.
ExamplePaste a minified response and see each field on its own line.
Find the exact line and column of a syntax error.
Example“line 12, column 5” points at the trailing comma.
Tidy package.json, tsconfig or app settings.
ExampleChoose 2 spaces to match most JavaScript projects.
Sort keys so two files line up.
ExampleSort both, then compare them in JSON Diff.
Minify JSON before embedding or sending it.
ExampleA 47-byte formatted object becomes 33 bytes.
Objects copied from code often have single quotes.
ExampleTry to fix turns {name: 'x',} into valid JSON.
Valid JSON, first time
Keys and strings need double quotes; no trailing commas, comments or undefined.
Try to fix changes your text. Read the result, especially strings that contained quotes.
This tool runs in your browser, but avoid pasting live API keys into any website.
Senior Software Engineer · Developer of Toolyconvert
Hemant developed JSON Formatter and tests it on desktop and mobile with real files. He is a senior software engineer from Dehradun, India, building websites since 2014, and designed and developed Toolyconvert end to end.
Last updated 14 November 2026
Featured on
Toolyconvert is listed on these product directories and launch platforms.