JSON Formatter & Validator

Paste JSON to check that it’s valid and format it for reading, or minify it to save space. Errors are explained with the exact line and column.

Paste JSON to validate and format it.

Processed in your browser. Your JSON is never uploaded or saved.

How to format and validate JSON

  1. Paste your JSON into the input box, or load the example.
  2. It’s validated as you type. If there’s an error, you’ll see what’s wrong and where, and “Show in input” takes you there.
  3. Choose Format (2 spaces, 4 spaces or tabs) or Minify, then copy or download the result.

Common JSON errors and how to fix them

  • Trailing commas: [1, 2, 3,] works in JavaScript but not in JSON. Remove the comma after the last item.
  • Single quotes: text and property names need double quotes, "name" and not 'name'.
  • Property names without quotes: {name: "Ana"} must be written {"name": "Ana"}.
  • Comments: JSON doesn’t allow // or /* */ comments.
  • Values from other languages: undefined, NaN and Infinity don’t exist in JSON, use null. Python’s True, False and None are written true, false and null.
  • Line breaks and tabs inside text must be written as \n and \t.

Your JSON is kept exactly as written

Many formatters turn JSON into JavaScript objects and back, which silently changes the data: numbers with more than 15 or 16 digits get rounded (12345678901234567890 becomes 12345678901234567000), keys that look like numbers move to the front and repeated keys disappear.

This tool reformats the text itself, so only the spacing changes: numbers, key order, escapes and repeated keys stay as they are. If an object repeats a key, you’ll see a warning, because most programs keep only the last value.

Format or minify?

Formatted JSON puts each item on its own line, with indentation that shows the structure, so it’s easy to read and compare. Minified JSON removes every unnecessary space and line break: it’s smaller to send and store, which is why APIs often use it. Both contain exactly the same data.

Your JSON never leaves your browser

Validation and formatting run on your device. The JSON you paste is not sent to our servers or saved, so you can use it with API responses, configuration files or data with personal information.

Frequently asked questions

What makes JSON valid?

JSON (RFC 8259) allows objects in braces, lists in square brackets, text in double quotes, numbers, true, false and null. Property names go in double quotes, and items are separated by commas with no comma after the last one.

Does formatting change my data?

No. Only the spaces, tabs and line breaks between values change. Text, numbers, key order and escapes are kept exactly as in your input.

Why does the error point somewhere unexpected?

The position shows where the problem was noticed, which can be just after the real mistake. A missing comma, for example, is detected at the start of the next value, so check the end of the previous line too.

Can it fix my JSON automatically?

No. Automatic fixes can change your data in ways that are easy to miss, so the tool tells you exactly what is wrong and where, and you decide how to fix it.

Is there a size limit?

There’s no fixed limit. JSON of several megabytes is processed in about a second; very large inputs depend on your device’s memory.

View all tools

Convert CSV files to Excel XLSX spreadsheets.

JSON to CSV

Soon

Flatten JSON arrays into CSV.

JSON to YAML

Soon

Convert JSON to YAML and back.