Skip to content

JSON formatter and validator

Paste JSON or open a file and it is checked and formatted right away, pretty-printed or minified. Mistakes are shown with their position and how to fix them.

Format

Paste JSON to check and format it.

The JSON is checked and formatted inside this tab and never sent anywhere.

Instant conversion

There is no upload or server queue, so conversion starts the moment you drop a file and finishes as fast as your device can process it.

Your files stay private

Files are processed entirely inside your browser. They are never sent to, stored on, or seen by any server.

Nothing to install

Works on Windows, macOS, Linux, Android and iOS in any modern browser. No software, no extensions, no account.

How to use JSON formatter and validator

  1. 1

    Paste JSON into the JSON box, or click "Open file" to load a .json file. You can also drop a file onto the box.

  2. 2

    Pick "2 spaces", "4 spaces" or "One line (minify)". The result updates instantly.

  3. 3

    If there is a problem, fix it at the line and character shown. "Show it in the input" moves the cursor to that spot.

  4. 4

    Click "Copy" to copy the result or "Download .json" to save it.

When to use it

  • An API response on one long line: expand JSON copied from developer tools or logs to see its structure
  • A config file that will not load: when a program only says “invalid JSON”, find the exact line and character
  • Smaller payloads: strip indentation and line breaks to send less data
  • Checking JSON made from a spreadsheet: view the output of XLSX to JSON in a readable layout

Common errors and how to fix them

Message Wrong Right
Comma after the last item {"a": 1, "b": 2,} {"a": 1, "b": 2}
Single quotes {'name': 'Kim'} {"name": "Kim"}
Key without quotes {name: "Kim"} {"name": "Kim"}
Missing comma between items {"a": 1 "b": 2} {"a": 1, "b": 2}
Backslash followed by something not allowed {"path": "C:\Users"} {"path": "C:\\Users"}
Comments are not allowed {"a": 1 // note} {"a": 1}
Only lower-case true, false and null {"ok": True, "x": None} {"ok": true, "x": null}
Something follows the end of the JSON {"a":1}{"b":2} [{"a":1}, {"b":2}]

A Python dictionary printed with print() fails because of its single quotes and True or None. Use json.dumps() in Python to get valid JSON.

The sizes above the result

Next to the result heading you see “original size → result size”: how much minifying saved, or how much pretty-printing added. Spaces inside text values are left alone; only spacing outside values changes.

Tools that go well with it

What is a JSON file?

JSON (JavaScript Object Notation) is the standard text format for structured data on the web. It represents objects as {"key": value} pairs and lists as [ … ], with strings, numbers, booleans and null as values. APIs, configuration files and NoSQL databases all use it.

Tabular data in JSON is usually a list of objects — one object per row, with column names as keys — or a list of arrays, one per row.

Frequently asked questions

The error position is slightly off from the real mistake.

The checker reads from the start and reports the first point where the text stops making sense. For a missing comma that is the start of the next item, so look at the end of the line just before. A trailing comma is pointed at exactly.

Does formatting change numbers or order?

No. Only spaces and line breaks are rewritten; every other character is kept. Very long numbers such as 12345678901234567890, numbers like 1.50 and repeated keys stay exactly as written, unlike tools that go through JavaScript and round long numbers.

Why are comments and single quotes errors?

Standard JSON does not allow comments, single quotes, unquoted keys or trailing commas. Variants such as JSONC and JSON5 accept them in some config files, but other programs and APIs will reject them, so the tool tells you what to change.

How large a JSON can it handle?

A few MB is formatted instantly. Beyond tens of MB the browser's text box itself becomes slow, and a code editor's formatter is the better choice.

What is the difference between 2 and 4 spaces?

Only the look. Two spaces keep deeply nested JSON on screen and are the most common; four make the levels stand out more. Follow your project's convention if it has one.

Is my JSON sent or stored anywhere?

No. Checking and formatting happen inside this tab and nothing is sent or saved, so JSON with API keys or personal data stays on your device. Closing the tab clears it.

Related guides

Related converters