Developer ToolboxRFC 8259
New here? Take a 30-second tour of how this page works.

JSON Formatter & Validator

Format, validate or minify JSON. Errors give the line, column and how to fix them.

RFC 8259Strict JSON · limit 10 MB · numbers and key order kept exactly

Options
Formatted output

Runs in your browser. Nothing you enter is sent anywhere. How to check

1.How to use

  1. Paste your JSON. It is checked and formatted as you type.
  2. Read the result. Valid JSON shows "Valid JSON" with the line count. Invalid JSON shows the first error with its line, column and a fix; Go to error puts the cursor on it.
  3. Copy the result, or download it as formatted.json or minified.json.

The tool is also a validator: if the output appears, the input is valid JSON. Inputs over 1 MB are processed when you press Format or Ctrl+Enter.

2.Examples

A minified API response

This input on one line:

{"id":4021,"name":"orders-api","regions":["eu-west-1","us-east-1"],"limits":{"rps":250,"burst":null},"active":true,"tags":[]}

formats with 2-space indentation to:

{
  "id": 4021,
  "name": "orders-api",
  "regions": [
    "eu-west-1",
    "us-east-1"
  ],
  "limits": {
    "rps": 250,
    "burst": null
  },
  "active": true,
  "tags": []
}

Common mistakes and their messages

3.Options explained

Format or Minify

Format puts each key-value pair and each array item on its own line, indented by depth. Empty objects and arrays stay as {} and [].Minify removes all whitespace outside strings, which gives the smallest valid file.

Indentation

Choose 2 spaces, 4 spaces or a tab per level. It applies to Format only. 2 spaces is the most common choice in JavaScript projects; some style guides prefer 4.

4.Limits

5.FAQ

Why is my JSON invalid?

The most common causes are a comma after the last item, single quotes instead of double quotes, keys without quotes, and comments. These are allowed in JavaScript but not in JSON. The error message names the problem and its position.

Does formatting change my data?

No. Only whitespace outside strings changes. Key order, duplicate keys, string escapes such as é, and numbers such as 1.0 or12345678901234567890 are kept exactly as written. A formatter that converts numbers to JavaScript numbers loses digits beyond 253; this one never converts them.

What about JSON with comments (JSONC)?

Files such as VS Code settings and tsconfig.json allow comments and trailing commas. This tool checks strict JSON, so it reports them as errors. Remove them to get standard JSON that every parser accepts.

What if a key appears twice?

The JSON is still valid, so both entries are kept and the status warns about the first repeated key. Most parsers keep only the last value, so a duplicate is usually a mistake (RFC 8259 §4).

Is my data uploaded?

No. Formatting and validation run in your browser. The privacy page shows how to confirm this in your browser's Network tab.