JSON Formatter and Validator: How to Fix Invalid JSON (and What Base64 Is)

Find the missing comma or quote in seconds.

JSON is the format most web APIs and config files use, and a single stray character can break it. A formatter makes the structure readable and a validator tells you exactly where it fails.

Most common JSON errors

MistakeWrongRight
Trailing comma{"a":1,}{"a":1}
Single quotes{'a':1}{"a":1}
Unquoted key{a:1}{"a":1}
Comments{"a":1 // note}JSON does not allow comments
Missing bracket{"a":[1,2}{"a":[1,2]}

Format and validate

  1. Open the JSON formatter and Base64 tool
  2. Paste your JSON
  3. Tap Format to indent it, Minify to compress it, or Validate to check it
  4. Read the error message, which points to the position of the problem

Everything runs in your browser. Nothing you paste is sent anywhere. Even so, avoid pasting live API keys or passwords on a shared computer.

What is Base64?

Base64 turns binary data or text into a string of letters, numbers, + and /. It is used to embed small images in HTML or CSS, to carry data in URLs and email, and in some API fields. It is not encryption: anyone can decode it. Never use it to hide passwords.

The tool in this site encodes text as UTF-8 first, so characters outside basic English, such as accents, Thai or emoji, round-trip correctly.

Open the JSON and Base64 tool

FAQ

What is the difference between format and minify?

Format adds line breaks and indentation for humans. Minify removes all unneeded whitespace to save bytes.

Why does JSON.parse say 'Unexpected token'?

Usually a trailing comma, single quotes, or a missing bracket at or just before the position the message names.

Is Base64 secure?

No. It only changes how data is represented. Use real encryption for secrets.

More articles