JSON Formatter & Validator
Format, minify and validate JSON online with line-accurate error messages.
Runs in your browser. Nothing is uploaded.
What is JSON Formatter & Validator?
A JSON formatter turns compact or messy JSON into clean, indented text that is easy to read, and a JSON validator tells you whether the text is valid JSON at all. This tool does both in one place: paste your JSON, see immediately whether it is valid, and format it with two spaces, four spaces or tabs, or minify it to the smallest possible size.
When your JSON has a mistake, the tool shows the problem in plain language together with the exact line and column, and highlights that line in the editor. Typical issues it catches include trailing commas, single quotes instead of double quotes, unquoted property names, comments, unclosed brackets and invalid escape sequences.
Everything runs locally in your browser. Your JSON is never uploaded, which makes this a safe place to inspect API responses, configuration files and payloads that contain tokens or personal data. The formatter also keeps your data exactly as written: long numbers such as 12345678901234567890, numbers like 1.0 and duplicate keys are not rounded, rewritten or dropped.
How to use
- Paste your JSON into the input box, or click Load sample to try an example.
- Watch the status line: it says Valid JSON, or shows the error with its line and column.
- Choose an indentation (2 spaces, 4 spaces or tab) and click Format, or press Ctrl/Cmd + Enter.
- Click Minify if you want the smallest single-line version instead.
- Use Copy to copy the result, or Download .json to save it as a file.
Example
Input
{"name":"Toolsy","tags":["json","formatter"],"free":true}Output
{
"name": "Toolsy",
"tags": [
"json",
"formatter"
],
"free": true
}Frequently asked questions
- Is my JSON uploaded to a server?
- No. Formatting, validation and minifying all happen in your browser. Nothing you paste is sent over the network.
- Why does my JSON say it is invalid?
- The most common causes are a trailing comma after the last item, single quotes around strings or keys, property names without quotes, comments, or a missing closing bracket. The error message shows the line and column so you can jump straight to the problem.
- Does the formatter change my numbers or key order?
- No. Numbers and strings are copied exactly as you wrote them and keys stay in their original order, so large integers and values like 1.0 are not altered.
- How large a file can I format?
- Documents of several megabytes work. Above about 400 KB the tool switches to a plain text box and processes your JSON in the background so the page stays responsive; live checking is paused, so use the Validate or Format buttons.