Online JSON Repair & Auto-Fixer

Paste broken JSON, a JavaScript object, a Python dict, a cut-off API response or ChatGPT output and get valid, formatted JSON with a list of every fix.

Runs locally 0 lines • 0 bytes Ready
Tip: drop a file anywhere on the page
Input
Paste, type or drop a file
Result
Updates as you type
// Output will appear here…
About this tool

How the JSON Repair works

Fix invalid JSON instantly: missing brackets, truncated responses, trailing commas, single quotes, Python dicts, comments and LLM output. Runs in your browser.

How to use the JSON Repair

  1. Paste broken JSON: a JavaScript object, a Python dict, a cut-off API response or an AI answer.
  2. The repair reads it token by token and fixes quotes, keys, commas, comments, literals and missing brackets.
  3. Review the list of fixes, then copy or download the valid JSON.

JSON Repair example

Input
{name: 'Ali', tags: ['a','b',], active: True,}
Result
{
  "name": "Ali",
  "tags": ["a", "b"],
  "active": true
}
Fixed: unquoted keys, single quotes, trailing commas, True → true

When to use it

  • Converting Python print() output into valid JSON.
  • Fixing JSON produced by LLMs or copied from JavaScript code.
  • Recovering truncated API responses and log lines.
  • Rescuing hand-edited config files.

Tip: Always check the list of changes; repair guesses intent, and very broken input may need a manual look.

Closes Truncated JSON

Adds missing closing brackets, braces and quotes when a response or log line was cut off, and completes partial true/false/null values.

Python & JavaScript Syntax

Converts True/False/None, single and backtick quotes, unquoted keys, comments, NaN/undefined, hex numbers and "a" + "b" concatenation.

LLM & Copy-Paste Clean-up

Strips Markdown code fences, text around the JSON, JSONP callbacks, smart quotes and invisible spaces; wraps JSON Lines in an array.

Safe for String Contents

A real tokenizer, not find-and-replace: URLs, "//" and words like True inside strings are never changed. Big numbers keep every digit.

FAQ

Common questions

What kind of broken JSON can this tool repair?

Missing or mismatched closing brackets, truncated output, trailing and missing commas, missing colons and values, single or curly quotes, unquoted keys and values, unescaped quotes and line breaks inside strings, comments, Python True/False/None and tuples, NaN/Infinity/undefined, hex numbers, MongoDB wrappers such as ObjectId("…"), JSONP and escaped (stringified) JSON.

Can it fix JSON that was cut off in the middle?

Yes. When an API response, log line or AI answer stops early, the repair closes the open string, adds null for a property without a value and appends every missing } and ] in the right order.

Does repair modify string contents?

No. The input is read token by token, so text inside strings — URLs with //, the word True, quotes inside quotes — stays exactly as written. Only the syntax around values is fixed.

How do I fix JSON returned by ChatGPT or another LLM?

Paste the whole answer. The tool removes the surrounding sentences and ```json fences, fixes the usual syntax slips, and lists each change so you can review it.

Is my data uploaded anywhere?

No. Repair runs entirely in your browser, so API keys, customer records and production payloads never leave your device.