Skip to content

JSON Repair

Fix broken JSON: trailing commas, single quotes, unquoted keys and comments.

Quick Tool Overview

The JSON Repair tool reads the near-miss dialects people actually paste — JavaScript literals, Python dicts, commented configs, truncated responses — and writes back strict JSON, listing every assumption it made along the way.

What it does
Repairs invalid JSON and explains every fix
You give it
Broken, truncated or almost-JSON text
You get back
Valid strict JSON plus a list of the changes made
Best for
Log lines, LLM output, hand-edited configs and truncated responses
Developer Tools Free, unlimited use No sign-up Runs in your browser

About the JSON Repair

Most broken JSON is not really broken — it is a near-miss dialect. A JavaScript object literal, a Python dictionary printed to a log, a config file with comments, or a response that was truncated before its brackets closed. The repairer reads all of those and writes back strict JSON.

It handles unquoted keys, single and backtick quotes, trailing and doubled commas, // and /* */ and # comments, Python's True, False and None, NaN and Infinity, raw line breaks inside strings, hex and underscore-separated numbers, and documents that simply stop. Every change is listed under the output, so you can see exactly what was assumed rather than trusting a silent fix — which matters when the thing being repaired is a log line you are about to draw a conclusion from.

Key features of the JSON Repair

Every fix is listed

Nothing is repaired silently. The list under the output tells you whether a comma was dropped or a truncated array was closed — a very different situation.

Handles the common dialects

Unquoted keys, single and backtick quotes, // and /* */ and # comments, and Python's True, False and None all read correctly.

Closes truncated documents

A response that stops mid-array is closed at the cut point so you can read what did arrive.

Fixes numbers JSON rejects

Hex literals, underscore separators and leading plus signs are rewritten; NaN and Infinity become null, because JSON has no literal for them.

Formats the result

The repaired document comes back indented and readable, not as one unbroken line.

How to use the JSON Repair

  1. 1

    Paste the broken JSON

    A JavaScript literal, a Python dict, a commented config or a truncated response all work.

  2. 2

    Read the repair list

    Every assumption the repairer made is listed under the result, in plain English.

  3. 3

    Check the output

    The repaired document is valid strict JSON, formatted with the indentation you choose.

  4. 4

    Copy the result

    Take the fixed document to your clipboard or download it as a .json file.

Frequently asked questions

It fixes the common near-miss dialects and truncation. Text that is not structurally JSON at all — an HTML error page, for example — cannot be repaired into a document, and the tool says so rather than guessing.

Reviews of the JSON Repair

What people who use the JSON Repair think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the JSON Repair. It takes half a minute and no account.

Write the first review

More developer tools