JSON Formatter

Runs in your browserDeveloper Tools#JSON

Format, validate and minify JSON with line-and-column errors and a tree view. Runs in your browser.

Formatted JSON
The result appears here as you type.
How to use, limits & privacy

About JSON Formatter

Format, validate and minify JSON in your browser. The result updates as you type, errors show the line and column with a hint on how to fix them, and a tree view lets you fold large objects. Numbers, text and keys are kept exactly as written, so IDs larger than JavaScript can hold are not rounded. Useful for developers, testers and anyone who gets JSON from an API, an app export or a government portal.

How to Use

1

Paste or open your JSON

Paste it into Input JSON, drop a .json file on the box, or click Open file. Click Example to see how it works.

2

Choose the output

Pick Format or Minify, an indent of 2 spaces, 4 spaces or a tab, and turn on Sort keys A–Z if you want keys in order. Switch the result between Text and Tree.

3

Fix errors and copy

If the JSON is invalid, the box below shows the line, the column and how to fix it. When it is valid, click Copy or Download, or Send to another tool such as JSON to TypeScript.

Privacy & Processing

  • Mode: local
  • Files Leave Browser: Local tool processing; review details below
  • Max Input Size: Device memory limits
  • Account Required: No
  • Data Stored Locally: Nothing is saved. "Send to" passes the result to the next tool in memory only.
  • Network Processing: Assets or models may require an initial download

Your JSON is processed in your browser and is never uploaded.

Rules & Limitations

  • Only strict JSON is accepted: no comments, trailing commas, single quotes or unquoted keys. The error message says which of these it found.
  • Numbers, strings and keys are printed exactly as written, so 1.50 stays 1.50 and 12345678901234567890 is not rounded. A warning appears for such big numbers because other apps may round them.
  • Duplicate keys are kept and reported, because most apps keep only the last value.
  • Nesting deeper than 1,000 levels is not supported. Very large files (tens of MB) may take a second or two on a phone.

Top Suggestions

  • Reading a minified API response while debugging
  • Checking a config or export file for a missing comma or quote
  • Minifying JSON before putting it in a request or a database field
  • Sorting keys so two JSON files are easier to compare
  • Exploring a large JSON file in a collapsible tree

JSON Formatter FAQ

How do I format JSON online?

Paste the JSON into Input JSON. It is formatted as you type with 2-space indentation; choose 4 spaces or a tab in Indent, then click Copy or Download.

Why does my JSON say invalid?

The error box shows the line and column and the likely cause. The most common ones are a trailing comma before } or ], single quotes instead of double quotes, keys without quotes, comments, and curly quotes copied from Word or WhatsApp.

Why does my JSON number change in other tools?

JavaScript stores numbers as 64-bit floating point, so whole numbers above 9,007,199,254,740,991 (2^53 − 1) are rounded by JSON.parse: 12345678901234567890 becomes 12345678901234567000. This formatter keeps the digits as written and warns you; store such IDs as strings.

What is the difference between formatting and minifying JSON?

Formatting adds line breaks and indentation so people can read it. Minifying removes all the spaces and line breaks to make the file smaller. The data is the same in both.

Is my JSON uploaded or saved anywhere?

No. Formatting and validation run in your browser, so the JSON never leaves your device and nothing is stored after you close the page.