JSON Converters Code Gen Formatters All tools Browse all tools built byAbhay Darji

JSON Repair

Fix broken JSON automatically — trailing commas, single quotes, unquoted keys, comments and unclosed brackets.

100% client side No upload No size limit Works offline
Input
Output
Ready
Drop a file to load it

About this tool

Repair the JSON that real systems produce: single quotes copied from JavaScript, trailing commas left by an editor, comments in a config file, a truncated response with unclosed brackets. The repairer works on the token stream, so it never corrupts the contents of your strings.

When you would use it

  • Rescuing a truncated log entry
  • Converting a JavaScript object literal into valid JSON
  • Stripping comments from a config file before a strict parser sees it

Worked example

Broken
{
  // user record
  name: 'Ada',
  roles: ['admin',],
}
Repaired
{
  "name": "Ada",
  "roles": [
    "admin"
  ]
}

Removed comments · Converted single quotes · Quoted bare keys · Removed trailing commas

Things worth knowing

  • Every repair is listed explicitly, so you can see exactly what was changed.
  • Repair is best-effort. If the document is too damaged to interpret unambiguously, it says so rather than guessing.
Questions

Frequently asked

Is repaired JSON guaranteed to be correct?
It is guaranteed to be valid JSON, and the listed repairs tell you exactly what changed. Where a document is ambiguous — a truncated file, for instance — always check the result against what you expected.
Is my data uploaded anywhere?
No. Every tool on JSONWorks runs entirely in your browser using JavaScript. Your input is never sent to a server, never logged and never stored. The simplest proof is to disconnect from the internet — the tools keep working. The site does load Google Fonts and a Google Analytics page-view tag, so you will see those two requests in your network tab, but neither receives anything you type or paste.
Does it work offline?
Yes. JSONWorks is installable as a progressive web app and caches itself on first visit, so every tool keeps working without a connection.
Related

Tools that pair well with this