All tools

JSON Repair

JSON

Fix malformed JSON: unquoted keys, single quotes, trailing commas, comments, undefined values, and unclosed brackets

Paste JSON that's technically broken, like a hand-written config with trailing commas and single quotes, or a JSON blob an LLM wrapped in markdown fences and comments, and this attempts to fix it: quoting unquoted keys, converting single quotes to double, stripping trailing commas and comments, replacing `undefined`/`NaN`/`Infinity` with `null`, and closing unclosed brackets. It's a set of regex-based heuristic fixups rather than a real lenient JSON5 parser, so on ambiguous or badly malformed input it can guess wrong or fail outright, and the output is always worth reviewing rather than trusting blindly. This is the tool for genuinely broken JSON; if your JSON already parses fine and you just want it pretty-printed or minified, JSON Formatter is the right one instead.

jsonrepairfixmalformedparseformat

How to use JSON Repair

  • 1.Paste JSON copied from a log file or LLM output that has unquoted keys or trailing commas to get it auto-fixed into valid, parseable JSON.
  • 2.Use it to clean up JSON-like config strings written by hand with single quotes or JS-style comments before loading them into a strict parser.
  • 3.Run an LLM's raw text response through it when the model wrapped valid-looking JSON with markdown fences or added a stray comment.

Frequently asked questions

What kinds of malformed JSON can it fix?
It handles unquoted keys, single-quoted strings, trailing commas, JS-style comments, `undefined` values, and unclosed brackets — common patterns from hand-written configs or LLM output.
Can it fix any broken JSON, no matter how mangled?
No — if the structure is too ambiguous (e.g. missing multiple brackets in a way that has no clear single fix), it may guess wrong or fail outright, so always review the repaired output.
Is my data sent to a server?
No, repair logic runs entirely in your browser.
Is this the same as the JSON Formatter tool?
No — the JSON Formatter only pretty-prints already-valid JSON, while this tool specifically attempts to fix syntactically broken JSON first.

Use via API, SDK, or MCP

cURL# Free: 1,000 req/day · Pro: 10,000 req/day
curl -X POST https://api.utilix.tech/v1/tools/repair-json \
  -H "Authorization: Bearer utx_live_..." \
  -H "Content-Type: application/json" \
  -d '{"json": "{\"name\":\"Alice\",\"age\":30,}"}'

Get an API key from your dashboard · Full API docs →