🧑‍💻

JSON Repair

🔒 In your browser

Fix broken JSON — quotes, trailing commas, comments.

Fixes the usual suspects: single quotes, unquoted keys, trailing commas, comments, and undefined/NaN. It's heuristic — always eyeball the result.

About the JSON Repair

Copied JSON often arrives broken — single quotes instead of double, a trailing comma after the last item, unquoted keys, or comments that aren't part of the JSON standard. This free JSON repair tool automatically fixes those common problems and turns malformed JSON into valid, parseable JSON so you can get back to work instead of hunting for a stray comma.

Paste your broken JSON and get a corrected, standards-compliant version back instantly. The repair runs entirely in your browser, so even sensitive API responses and config data never leave your device.

What it fixes

  • Single quotes converted to the double quotes JSON requires.
  • Trailing commas after the last element of an object or array removed.
  • Unquoted object keys wrapped in quotes.
  • JavaScript-style comments (// and /* */) stripped out.
  • Python-style values like True, False and None mapped to true, false and null.
  • Missing commas between items inferred where it's unambiguous.

Why JSON breaks in the first place

Most invalid JSON comes from a place that looks like JSON but isn't. A JavaScript object literal allows single quotes, unquoted keys, trailing commas and comments — none of which strict JSON permits. Config files, logs and chat messages often carry those habits over. Copying a fragment out of a larger document, or hand-editing a file, is the other common source: it's easy to leave a dangling comma or drop a closing brace.

Repair vs. fixing the source

This tool is for getting unblocked quickly — pasting a broken blob and getting valid JSON to work with. If the broken JSON is being produced by your own code, repairing the output each time only hides the bug; fix the serializer at the source so it emits valid JSON directly. Once your JSON parses, the JSON Formatter and JSON Tree Viewer help you read and verify it.

Frequently asked questions

What does the JSON repair tool fix?

It fixes the common issues that make JSON invalid: single quotes, trailing commas, unquoted keys, comments, and Python-style True/False/None values — producing standards-compliant JSON that any parser will accept.

Will it change my data?

It only corrects syntax so the JSON parses; it doesn't alter your actual values. Because it also strips comments (which aren't valid JSON), review the output to confirm nothing meaningful was in them.

What's the difference between repairing and formatting JSON?

Repairing makes invalid JSON valid — it fixes structural errors. Formatting (beautifying) takes already-valid JSON and makes it readable with indentation. Repair first, then format.

Why can't some JSON be repaired automatically?

If a document is badly truncated or ambiguous — for example a value that could be a string or a number, or several missing braces at once — there's no single correct interpretation, so it can't be safely guessed. In that case the tool reports where parsing fails.

Is my JSON sent anywhere?

No. The repair happens entirely in your browser, so sensitive API responses and config data are never uploaded.

Related searches

json repairfix jsoninvalid jsonbroken jsonjson fixertrailing comma jsonrepair json onlinejson syntax error

Related Developer tools

🔗 Embed this tool on your website — free

Copy this and paste it into your page's HTML. The tool runs in the visitor's browser, just like here. Change height to fit, or add the optional auto-resize snippet below. Add ?theme=dark to the URL for dark mode.

<iframe src="https://toolhq.dev/embed/json-repair/" title="JSON Repair — ToolsHub" width="100%" height="520" style="border:1px solid #e5e7eb;border-radius:12px;max-width:680px" loading="lazy"></iframe>
Optional: auto-resize the iframe height

Add this once on the same page so the iframe grows to fit the tool:

<script>
addEventListener("message", function (e) {
  if (e.data && e.data.type === "toolshub:resize") {
    document.querySelectorAll('iframe[src*="/embed/"]').forEach(function (f) {
      if (f.contentWindow === e.source) f.style.height = e.data.height + "px";
    });
  }
});
</script>