Skip to the tool
GigaJSON

JSON Repair

All tools
Format and check
View and query
Convert
JSON to code
Encode and decode
Sample files
Guides Open GigaJSON
Input JSON
Output JSON

The JSON output appears here as you type.

Ready Runs in your browser

Paste broken JSON and get valid JSON back. Repair handles missing or single quotes, missing commas and brackets, trailing commas, comments, cut-off documents, Python's True/False/None, JSONP, and JSON copied out of an AI chat with text around it. Each line it changed is listed. To only check whether JSON is valid, use the JSON Validator.

How to use it

  1. Paste the broken JSON or open a file.
  2. The repaired JSON appears, with a list of the lines that changed.
  3. Copy or download it, or open it in GigaJSON to keep working on it.

Read more: A JSONLint alternative for large JSON files · Unescape JSON: fix strings full of backslashes · n8n $json expressions explained: paths, items and $jmespath · How to open a JSON file on Windows, Mac, a phone or in Excel · How to fix invalid JSON: the 10 most common errors

Private, and made for big files

This tool runs in your browser, in a background worker: nothing you paste or open is uploaded, and nothing is kept after you leave. Input is limited to 128 MB. Processing runs in a background worker. Already loaded features keep working if your connection drops. Loading another tool or jq for the first time needs a connection. When one tool isn't enough, GigaJSON opens your data with a tree, a table, JSONPath/JMESPath/jq queries, transforms, diff and history.

Repair a trailing comma, then check the result

Input: {"id":"ord_002","status":"pending",}. JSON does not allow the comma before the closing brace. Repair produces {"id":"ord_002","status":"pending"}.

A successful parse only proves the result is valid JSON. It does not prove that missing values were recovered correctly. Compare important fields before using a repaired response. See ten common JSON errors for examples you can identify and fix yourself.

GigaJSON JSON repair tool removing a trailing comma from an order objectGigaJSON JSON repair tool removing a trailing comma from an order object (dark theme)
Repair removes this trailing comma. Check the output before using it. Screenshots follow the page theme. Click to view full size.

Questions

What can it repair?

Keys without quotes, single or curly quotes, missing commas, missing closing brackets (cut-off JSON), trailing commas, // and /* */ comments, Python constants, MongoDB types like NumberLong(), JSONP, string concatenation, newline-delimited JSON and Markdown code fences.

How do I fix invalid JSON?

Paste it above. Repair rewrites it as valid JSON and lists every line it changed, so you can check the result. To find the error yourself instead, the JSON Validator shows its line and column.

What can't it repair?

Anything ambiguous, such as a doubled comma between values. Instead of guessing, it tells you the line and column.

Can it fix JSON copied from ChatGPT or another AI?

Yes. When the answer has the JSON in a Markdown code block, Repair uses the block and drops the text around it, then fixes trailing commas, comments or a cut-off end. Check the result: Repair makes the text valid, but it can't tell whether the AI left data out.

Is my data uploaded?

No. The tool runs in your browser, in a background worker. Nothing you paste or open goes to a server, and nothing is kept after you leave the page.

All tools