>_devtools

JSON Repair

Fix broken JSON: trailing commas, comments, single quotes, unquoted keys, truncated output, and Python constants.

What this does

Turns almost-JSON into valid JSON. Paste output from a log, a chat model, a config file, or a hand-edited snippet and get a clean, pretty-printed document back.

Repair is powered by the open-source jsonrepair library, which reads the text leniently and rewrites it to its best interpretation.

What it can fix

  • Trailing commas, missing commas, and missing closing brackets or braces (truncated output).
  • Single quotes, curly quotes, and unquoted keys.
  • // line and /* block */ comments.
  • Python constants True, False, None and JavaScript undefined, NaN.
  • Markdown code fences around the JSON, and several JSON values on separate lines (collected into an array).
  • Strings concatenated with +, and unescaped control characters inside strings.

Read the result before you rely on it

Repairing is guesswork by nature. When a document was cut off mid-value, the tool closes it where it stopped; it cannot recover data that is not there. If the input is already valid JSON the tool tells you so and only re-formats it.

Text that does not look like JSON at all is rejected rather than wrapped in a string.

Example

Input:

{
  // user record
  name: 'Ada',
  "tags": ["a", "b",],
  active: True

Result:

{
  "name": "Ada",
  "tags": ["a", "b"],
  "active": true
}

Privacy

Everything runs in your browser. Your input is never uploaded, stored, or put in the page URL.