Broken JSON
JSON
Empty Runs in your browser

JSON Repair - Fix Invalid and Broken JSON Online

Paste JSON that will not parse and get valid JSON back. The repair fixes trailing commas, single quotes, unquoted keys, comments, Python-style True/None, missing brackets and output that was cut off mid-way, which is common with AI chat responses.

How to repair JSON

  1. Paste the broken JSON into the left editor, or open or drop a file.
  2. Press Repair (or Ctrl+Enter), or leave Live on to repair as you type.
  3. Valid, formatted JSON appears on the right. Check it in tree view, then copy or download it.

What it fixes

Check the result

Repair is a best guess. When text was cut off, the missing part cannot be recovered, only closed off. Look over the output before you use it, and use JSON Compare if you want to see exactly what changed between two versions. If the input was already valid, the status line says so and the output is simply formatted.

If something cannot be repaired, the error points to the line and column where the repair stopped.

Example

{
  name: 'Ada Lovelace',
  languages: ['English', 'French',],
  active: True,
  // cut off here
  projects: [{title: 'Analytical Engine'

becomes valid JSON with quoted keys, double quotes, true, no comment and closed brackets.

Private by design

The repair runs in your browser using the open-source jsonrepair library. Nothing you paste is uploaded.

Frequently asked questions

How do I fix invalid JSON?

Paste it into JSON Repair. It fixes trailing commas, missing commas, single quotes, unquoted keys, comments, Python values like True and None, and missing closing brackets, and gives you valid, formatted JSON.

Can it fix JSON from ChatGPT or other AI tools?

Yes. It removes Markdown code fences around the JSON and closes JSON that was cut off part way, which are the most common problems with AI-generated JSON.

Will repairing change my data?

It changes only what is needed to make the JSON valid. When JSON was cut off, the missing part cannot be recovered, only closed, so check the result before using it.

Can it convert a JavaScript object to JSON?

Yes. Unquoted keys, single quotes, trailing commas and comments are all fixed, so a JavaScript object literal becomes valid JSON.

What if the JSON cannot be repaired?

The error shows the line and column where the repair stopped, so you can fix that part by hand and try again.

Editor settings

Type

{
  "id": 1024, "name": "Ada", "active": true,
  "tags": ["0O", "1lI", "=> != >="], "manager": null
}

Colour theme

Code editor

Defaults

Send feedback

How is online-json working for you?