EditSafely

Fix JSON

Repair a damaged JSON file to the best of our ability. Runs entirely in your browser, so your data never leaves your device.

0 chars · 0 lines

Output

The result appears here as you type.

Options

How to use Fix JSON

  1. 1. Paste your broken JSON. Put the malformed JSON into the input pane, whether it has unquoted keys, trailing commas, missing brackets, or other common mistakes that keep it from parsing.
  2. 2. Decide whether to prettify. Turn on Prettify the result to get the repaired JSON nicely indented, or leave it off if you just want the fix applied with minimal reformatting.
  3. 3. Pick an indent. If prettifying, choose 2 spaces, 4 spaces or tabs to control how the repaired document is formatted before you copy it out.
  4. 4. Copy the repaired JSON. Copy the fixed document, which now parses as valid JSON, and use it wherever the original broken version was rejected by a parser or validator.

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,658 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. Because the work happens on your own device rather than on a shared server, the practical ceiling is your machine's memory, which comfortably handles inputs far larger than typical online tools allow.

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