JSON formatter and validator.
Paste JSON to check that it's valid and make it readable. If something is wrong, you'll see the line and column, and a likely fix. You can also minify it or sort its keys. Your data never leaves your browser, so it's safe to paste API responses.
- Free, no sign-up
- Runs in your browser. Nothing you enter is sent to us.
Result
How to use the JSON Formatter & Validator
- Paste your JSON into the box.
- Valid JSON is formatted straight away. An error shows its line, column and a likely cause.
- Choose Format or Minify, the indent, and whether to sort keys.
- Copy the result, or download it as a .json file.
The mistakes that break JSON most often
- A trailing comma after the last item: {"a": 1,} isn't allowed.
- Single quotes: strings and keys must use double quotes.
- Keys without quotes: {name: "Ali"} is JavaScript, not JSON.
- Comments: JSON has none, so // and /* */ must go.
- Values JSON doesn't have, such as undefined or NaN.
Where you'll meet JSON on a website
Besides APIs and config files, JSON powers structured data: the JSON-LD blocks that describe your business and pages to search engines. One stray comma can stop a whole block from being read. Our schema markup generator writes valid JSON-LD for you, and the local business schema generator covers your address and opening hours.
Very large numbers
JavaScript can only hold whole numbers exactly up to about 16 digits, so a longer one, such as some database IDs, can change when it's formatted. If your JSON contains one, this tool warns you. Keep those values as strings, or edit them in a tool that keeps big numbers intact.
About the JSON Formatter & Validator.
Is it safe to paste private data here?
The tool runs in your browser and sends nothing to us. Even so, follow your company's rules for handling sensitive data.
What is the difference between formatting and minifying?
Formatting adds line breaks and indents for people to read. Minifying removes them to make the file smaller. The data itself stays the same.
Does sorting keys change my data?
No. The order of keys has no meaning in JSON, though the order of items in a list does, so lists are left alone. Sorting makes two files easier to compare.
Why does it say unexpected token?
The parser met a character it did not expect at that spot. The real mistake is often just before it, like a missing comma on the previous line.
How large a file can it handle?
Several megabytes is usually fine on a computer. Very large files can be slow, since everything runs on your device.
You might also need these.
Schema Markup Generator
JSON-LD for FAQ, local business, organisation, article, breadcrumb and product, plus a quick validator.
Use the toolHTML, CSS & JS Minifier
Shrink HTML, CSS and JavaScript by removing comments and extra spaces, and see how much you saved.
Use the toolHTML Formatter & Beautifier
Turn messy or minified HTML into clean, indented code you can read, in your browser.
Use the toolWant this done for you?
Free tools show you what to fix. We fix it, measure it, and keep it working while you run the business.