Skip to content
ToolsFort home

JSON Formatter & Validator

Format, beautify, minify and validate JSON with syntax highlighting, key sorting and precise error locations.

Updated

Output

        
Waiting for input…

Paste raw or minified JSON to pretty-print it instantly. Invalid JSON is flagged with the exact line and column of the problem so you can fix it fast.

How to use the JSON Formatter & Validator

  1. 1 Paste JSON into the input box — it is validated as you type.
  2. 2 Choose indentation and optionally sort keys alphabetically.
  3. 3 Click Format or Minify, then copy or download the result.

Worked examples

Beautify

Input: {"name":"Ada","tags":["math","code"]}

Result: Indented, colour-highlighted JSON

Find an error

Input: {"a": 1,}

Result: Invalid JSON at line 1

Trailing commas are not allowed in JSON

Common JSON errors

  • Trailing commas — {"a": 1,} is valid JavaScript but invalid JSON.
  • Single quotes — JSON strings and keys must use double quotes.
  • Unquoted keys — {name: "Ada"} must be {"name": "Ada"}.
  • Comments — standard JSON does not allow // or /* */ comments.
  • Special values — NaN, Infinity and undefined are not valid JSON.

Format vs. minify

Formatting adds indentation and line breaks for humans. Minifying removes all unnecessary whitespace to make payloads smaller for APIs and storage — the data is identical.

Runs locally

Everything happens in your browser — nothing you paste is uploaded or logged, so it is safe to use with API responses, tokens and internal data.

Frequently asked questions

How do I validate JSON?

Paste it into the input — the status bar shows "Valid JSON" or the exact location of the first error.

Does sorting keys change my data?

No. Object key order has no meaning in JSON, so sorting only changes presentation. Array order is preserved.

How large a file can I format?

Several megabytes work comfortably. Syntax highlighting is skipped above 1 MB to keep the page fast.

Esc