Skip to content
Pro
TREN

JSON Formatter and Validator

Make JSON readable, minify it or find the line of an error. Everything runs in your browser, so the data goes nowhere.

How it works

  1. Paste your JSON into the left panel.
  2. Pick an action: Format, Minify or CSV.
  3. Copy the result or download it as a file.

Why this tool

  • Format with an indent of 2 spaces, 4 spaces or a tab.
  • Minify to drop whitespace and cut the file size.
  • Print the line and column of a syntax error.
  • Sort keys to make two files easy to compare.
  • Export flat arrays to CSV. The data stays in your browser.

JSON is a simple format, but a strict one. Most errors come from the same four causes. First, a comma after the last item. A JavaScript object accepts it. JSON does not. Second, a key without quotes. {name: "May"} is invalid and {"name": "May"} is valid. Third, single quotes. JSON accepts double quotes only. Fourth, comments. JSON has no comment syntax.

When the tool finds an error, it prints a line and a column. That position is where the parser gave up, not always where the mistake is. A missing comma or an extra bracket usually sits on the line above, so read upward from there.

Format mode is for reading. Set the indent to 2 spaces, 4 spaces or a tab. Minify mode does the opposite and removes all whitespace. On config files and API responses a gain of 10 to 30 percent is normal.

Sort keys helps when you compare two files. Sort and format both, then paste them into Text Compare. The real difference then stands out.

CSV export is for flat data. An array of objects becomes a table. Nested values are written into the cell as JSON text.

Everything runs in your browser. It is safe to paste a response that holds a token or personal data.

Frequently asked questions

What are the most common JSON errors?

A comma after the last item, a key without quotes, single quotes, and comments. JSON accepts none of these.

How does it find the error position?

The browser JSON parser reports a position. The tool turns that into a line and a column. The real mistake is often on the line above.

Does my data go to a server?

No. Parsing and formatting run in your browser. It is safe to paste a response that holds a key or personal data.

What does minify save?

It removes indents and line breaks. On config files and API responses a gain of 10 to 30 percent is normal.

What does the CSV export support?

A flat array of objects, or a single object. Nested values are written into the cell as JSON text. It does not suit deep structures.

Do you support JSON5 or JSONC?

No. Forms with comments or unquoted keys are rejected. Use standard JSON.