Skip to content
RoomCalcs

JSON formatter & validator

Paste JSON or open a file to format it neatly, minify it, or check it. If something is wrong, you see the exact line and column with a plain-English fix. Browse it as a tree, sort keys, and convert JSON to CSV and back. Big numbers stay exactly as written, and your data never leaves your browser.

  • Free
  • No sign-up
  • Private — runs in your browser

How do I format and validate JSON?

  1. 1Paste your JSON into the box, drop a file on it or tap “Open file” (or “Try an example”).
  2. 2Pick what to do: Format (2 spaces, 4 spaces or tabs), Minify, Tree view, JSON → CSV or CSV → JSON.
  3. 3If it isn't valid, read the line and column, see the mistake marked with ^, and tap “Show me in the box” or “Fix common mistakes”.
  4. 4Copy the result or download it as a .json or .csv file.

How does the JSON validator find errors?

  1. 01Valid JSON = one value: object { }, array [ ], "text", number, true, false or null
  2. 02Object = { "key": value, … } — keys in double quotes, no comma after the last one
  3. 03Number = -? digits (no leading 0) [.digits] [e±digits]
  4. 04Minified size saving = (1 − minified bytes ÷ original bytes) × 100

The checker reads your text character by character and follows the grammar of RFC 8259, the JSON standard. It stops at the first place the text breaks the rules and reports that spot as a line and column (a tab counts as one column), then explains the usual cause: a trailing comma, single quotes, a missing comma or colon, a comment, NaN, a number with a leading zero, a bad backslash, and so on. It does not rely on the browser's own error message, which differs between Chrome, Firefox and Safari and often has no line number.

Formatting re-prints the same values with your choice of indent; minifying removes every space and line break outside text. Numbers and text are copied exactly as typed, so 1.0 stays 1.0 and a 19-digit ID is not rounded, which can happen with tools built on JavaScript's JSON.parse (it can hold whole numbers exactly only up to 9,007,199,254,740,991). For CSV, each item of the list becomes a row and every key becomes a column; text with commas, quotes or line breaks is put in quotes as RFC 4180 says.

Good to know

  • The most common mistake is a comma after the last item, like [1, 2, ]. JSON doesn't allow it, even though JavaScript does.
  • Keep IDs, phone numbers and ZIP codes as text in quotes ("01234"): numbers lose leading zeros and very long ones get rounded by many apps.
  • Turn on “Sort keys” before comparing two JSON files — the same data will then line up the same way.
  • For Excel in Europe and other countries that write 1,5 for one and a half, pick the semicolon separator when making a CSV.

JSON formatter — common questions

How do I know if my JSON is valid?

Paste it in the box. If it follows the JSON standard you see “Valid JSON” with its size and contents; if not, you see the exact line and column of the first mistake, the line itself with a ^ under the problem, and how to fix it.

Why is a trailing comma an error in JSON?

The JSON standard (RFC 8259) only allows commas between items, not after the last one. JavaScript and many config formats accept it, so it's a very common copy-paste mistake. “Fix common mistakes” removes trailing commas for you.

Can JSON have comments?

No. Standard JSON has no comments, so // and /* */ make it invalid. Some tools (like VS Code settings) accept “JSON with comments”, but most programs don't. “Fix common mistakes” strips them.

What's the difference between formatting and minifying JSON?

Formatting (pretty print, beautify) adds line breaks and indents so people can read it. Minifying removes all extra spaces and line breaks so the file is as small as possible for sending or storing. The data is the same either way.

How do I convert JSON to CSV for Excel?

Choose “JSON → CSV”. Your JSON should be a list of objects; each one becomes a row and each key a column (nested objects become columns like address.city). Download the .csv file and open it in Excel or Google Sheets.

Is my JSON uploaded anywhere?

No. Checking, formatting and converting all happen in your browser, on your device. Nothing is sent to a server or saved, so it's safe for private data and API keys.

Sources

Formulas last reviewed: September 30, 2026 ·How we check our formulas