JSON Formatter and Validator: Fixing “Not Valid JSON” Errors

What is it?

The JSON Formatter makes JSON readable or compact, sorts keys, and tells you exactly where invalid JSON breaks.

Who is it for?

Developers, testers and students working with APIs, config files and app data, and anyone who received JSON and needs to read or fix it.

How to use it

  1. Paste your JSON.
  2. Pick the Style: Pretty (2 spaces), Pretty (4 spaces), Pretty (tabs) or Minify (one line). Tick Sort keys A → Z to order keys, which makes two files easier to compare.
  3. Copy or download the result.

Fixing “Not valid JSON”

The message names the line and column. The usual causes are:

  • A trailing comma after the last item: [1, 2, 3,]. Remove it.
  • Single quotes: JSON needs double quotes: "name", not 'name'.
  • Keys without quotes: {name: "Ravi"} is JavaScript, not JSON.
  • Comments (// or /* */) are not allowed in JSON.
  • Smart quotes “ ” from Word or WhatsApp. Retype them as straight quotes, or clean the text with Text Cleaner.
  • A missing comma between two items, or a missing closing } or ] at the very end.

Good to know

Very large numbers (more than 15–16 digits, like some IDs) lose precision in JavaScript. Keep long IDs as strings. Your JSON is processed in the browser and not uploaded, so API keys inside it stay private.

Open the tool: JSON Formatter & Validator

Still stuck?

Contact support. Tell us which tool or page you were using, what you tapped, what you saw, and your phone or computer and browser (for example: Android phone, Chrome). We reply by email.

Questions, or an error not listed here?

Tell us in the comments: what you were doing, the exact message you saw, and your device and browser. We read every comment and add new fixes to this article.