Twinsoft Start a project

JSON formatter and repair

Format, validate and repair JSON that almost parses.

Runs entirely in your browser · nothing uploaded · free, no sign-up

Options

About this tool

Most JSON that fails to parse is broken in one of a handful of predictable ways: it came out of a Python program, it is really a JavaScript object literal, it is a config file with comments, or its quotes were autocorrected somewhere along the way.

This formats valid JSON and repairs the rest — converting single quotes to double, quoting bare keys, removing trailing commas and comments, and translating True, False, None and NaN into their JSON equivalents. It tells you exactly what it changed.

How to fix and format broken JSON

  1. Paste your JSON. Valid or broken — it tries a straight parse first and only repairs when that fails.
  2. Read what changed. If repairs were needed, every fix is listed so you can see exactly what was altered.
  3. Set the indentation. Two spaces, four spaces or tabs, and optionally sort object keys alphabetically.
  4. Copy or minify. Copy the formatted result, or press Minify for the smallest valid output.

What it supports

  • Single-quoted strings converted to double quotes
  • Unquoted object keys wrapped in quotes
  • Trailing commas removed
  • JavaScript and Python comments stripped
  • Smart quotes from word processors normalised
  • Python literals True, False and None converted
  • NaN and Infinity replaced with null
  • Byte-order marks removed

Questions

What can it repair?

Single-quoted strings, unquoted object keys, trailing commas, JavaScript and Python comments, smart quotes from word processors, byte-order marks, and non-JSON literals like True, False, None, NaN and Infinity.

Will it change data inside my strings?

No. Repairs are applied only outside string literals. The parser tracks whether it is inside a string, so a comma or a comment marker within your content is left alone — which is the failure mode of most find-and-replace approaches.

Is my JSON uploaded anywhere?

No. Everything runs in your browser. Nothing is sent to a server, which matters if the JSON you are debugging contains API keys, customer records or anything else you would not paste into a stranger's website.

What if it cannot be repaired?

You get the line and column of the failure and the surrounding text, rather than a generic error. Some documents are genuinely too broken to guess at, and we would rather say so than produce something subtly wrong.

Is it really free?

Yes, with no sign-up and no limits.

Built by a software company

We make tools like this for our own work. When a business needs something larger built properly, that is the day job.