About this tool
Format and validate JSON without sending it anywhere
Paste JSON, drop a .json file or open one, and get it neatly indented, minified or sorted, with any mistake pointed out to the exact line and column.
API responses, config files and logs often hold tokens, customer data or keys that should not be pasted into a website that sends them to a server. This formatter runs entirely in your browser tab, in a background worker, so even a file of several megabytes formats without freezing the page. Numbers and strings are copied through exactly as written, so a 19-digit ID keeps every digit, which tools built on JavaScript’s own parser can quietly round. When the JSON is broken you get the line and column, the text around it, and what usually causes that error.
- Free, no sign-up
- Nothing uploaded
- No watermark
Errors you can act on
Instead of “unexpected token”, see the line, the column and the likely cause: a trailing comma, a single quote, a missing comma or a key without quotes.
Fix common mistakes
JSON copied from JavaScript, Python or a config file often has comments, single quotes or trailing commas. One click rewrites it as valid JSON and lists every change.
Stays on your device
Your JSON is processed in this tab and never uploaded, logged or stored, so it is safe for API keys, tokens and private data.
Step by step
How to format JSON
Add your JSON
Paste it into the Input pane, drop a .json file on it, or press Open.
Choose the output
Format with 2 or 4 spaces or tabs, or minify it, and sort the keys if you like. Errors are shown with their line and column.
Copy or download
Copy the result or download it as a .json file. Switch to Tree to explore it.
Get the most out of it
Tips for the best results
- Read the first error firstOne mistake, such as a missing quote, can confuse everything after it. Fix the error shown, and the next one, if any, appears straight away.
- JSON is stricter than JavaScriptKeys need double quotes, strings can’t use single quotes, and comments, trailing commas, undefined and NaN aren’t allowed. Fix common mistakes handles all of these.
- Sort keys to compareSorting keys A to Z at every level makes two versions of the same data line up, so a diff shows only the real changes.
- Minify for sending, format for readingMinified JSON is smaller to send and store; formatted JSON is easier to read and review. The data is the same.
Keep going
More free tools
Questions
Common questions
Everything here runs in your browser, so the answer to “where does my file go?” is always: nowhere. More in the general FAQ.
How do I format JSON?
Paste your JSON into the Input pane, drop a .json file on it or press Open. It is formatted as you type; choose 2 spaces, 4 spaces or tabs, then copy the result or download it as a .json file.
How do I find the error in my JSON?
The panel shows the line and column of the first error, the text around it with a marker under the exact spot, and the usual cause. Press Show in input to jump to it in your JSON.
Why is my JSON invalid?
The most common causes are a comma after the last item, single quotes instead of double quotes, property names without quotes, comments, a missing comma between items, and a bracket or brace that is never closed. JSON also has no undefined, NaN or Infinity, and true, false and null must be lowercase.
What does Fix common mistakes change?
It removes comments and trailing commas, turns single quotes into double quotes, puts quotes around property names, adds missing commas between items, changes True, False and None to true, false and null, and replaces NaN and Infinity with null. It lists every change, and Ctrl+Z (⌘Z) undoes it.
Is my JSON uploaded?
No. It is processed by JavaScript in this browser tab and is never sent to a server or saved, so it is safe to paste API responses, tokens and configuration.
Can it handle large JSON files?
Yes. Formatting runs in a background worker, so a file of several megabytes is formatted in well under a second without freezing the page. Colour highlighting is switched off for very large results to keep scrolling smooth.
Will formatting change my numbers?
No. Numbers and strings are copied exactly as written, so very large integers such as 64-bit IDs keep every digit, and escapes such as \u00e9 are left as they are.
Does it warn about duplicate keys?
Yes. Duplicate keys are valid JSON, but most programs keep only the last one, so the panel lists them with their line numbers. For other text tools, try the word counter.