EditSafely

Fix JSON

Repair a damaged JSON file to the best of our ability.

Runs on your device, nothing uploaded

Indent
Try:

0 chars · 0 lines

Output

Repair a damaged JSON file to the best of our ability.

Type or paste above to see the result here.

Example: Repair unquoted keys and trailing commas

What you paste never leaves this tab

Fix JSON is JavaScript that your browser has already downloaded, and it does the whole job on your own machine. On a normal site, an API response with live access tokens in it is sent to a server that can log it, cache it or keep it. Here it is read and transformed inside this tab and nowhere else.

  • No upload
  • No length limit
  • Works offline once loaded
  • Nothing stored or logged

How to use Fix JSON

  1. 1. Paste your broken JSON. Put the malformed JSON into the input pane, whether it has unquoted keys, single quotes, trailing commas, missing brackets, comments or a cut-off end.
  2. 2. Choose the formatting. Turn on Prettify the result to get the repaired JSON neatly indented with 2 spaces, 4 spaces or tabs, or turn it off to keep your own layout and change only what was broken.
  3. 3. See what was fixed. The line above the result counts the repairs, for example 3 changes: 2 double quotes added, 1 comma removed. Open the Changes tab to see every character that was added in green or removed in red.
  4. 4. Copy or download the repaired JSON. Copy the fixed document, or download it as a -fixed.json file, and use it wherever the original was rejected by a parser.

When to use Fix JSON

Fix JSON repairs a damaged document to the best of its ability, handling issues like unquoted keys, trailing commas, and other common mistakes. It is for salvaging JSON that came from an imperfect source rather than tracking down and fixing each error by hand.

  • Recovering a truncated log line. A logging pipeline wrote a JSON line that got cut off mid-write during a crash, and you want to recover as much of the structure as possible instead of discarding it.
  • Fixing JSON5-style config. A config file was hand-written with trailing commas and unquoted keys the way JSON5 allows, but the tool reading it expects strict JSON. Fix it once and save the result.
  • Removing a stray comment. Someone left a JavaScript-style comment inside a JSON file, which strict JSON doesn't support. Fix JSON strips the offending syntax so the document parses again.
  • Cleaning up a hand-edited file. A developer manually edited a JSON file and accidentally left out a comma between two properties. Fix JSON restores it without you having to hunt for the exact spot.

Examples

Repair unquoted keys and trailing commas

Input

{name: 'Ada', age: 36,}

Output

{
  "name": "Ada",
  "age": 36
}

About the Fix JSON tool

Fix JSON runs as plain JavaScript in your browser tab, with no server behind it. Repair a damaged JSON file to the best of our ability. Whatever you put in stays on your device from start to finish.

The tool is part of EditSafely's JSON Tools section, 90 single-purpose utilities built around the same idea: open the page, get the result, keep your data to yourself.

You can shape the output with 2 settings, including Prettify the result and Indent, and the result refreshes the moment you change one. A worked example further down the page shows exactly what the tool produces for a real input.

That local-first design has practical benefits beyond privacy. The tool keeps working on a flaky connection once the page has loaded, results are instant because nothing round-trips to a server, and it is safe to use with confidential material.

Frequently asked questions

Is Fix JSON free to use?

Yes, it is completely free. All 2,943 tools on EditSafely work without an account, a subscription or usage limits.

Is it safe to paste sensitive or confidential data?

Everything happens locally. Your browser downloads the tool's code once, then does all the processing itself; nothing you enter is transmitted, stored or logged. You can even go offline after the page loads and it will still work.

How much text can I process at once?

There is no fixed limit; your device's memory is the ceiling. Up to 10 MB the result updates as you type, after a short pause that grows with the size. Above 10 MB a Run button appears so typing stays smooth, and files open up to 50 MB. A very long result shows its first 2,000 lines on screen, while Copy and Download always include all of it.

Do I need to sign up or install anything?

No. The tool works in any modern browser on desktop, tablet or phone. There is no account to create, no extension to add and no software to install.

How do I use the result?

The output panel has a one-click copy button, and you can keep refining the input while you work; the result updates in place as you type.

Related tools

All JSON Tools →