DevFlow logoDevFlow
ToolsPipelinesExploreDocsPricing
⌘F
DashboardPipeline BuilderAnalytics

Try Pro — Free 7 days

No credit card required

JSON Repair Tool — Fix Malformed JSON Online, AI Output Formatter

How to JSON Repair Tool Online

  1. 1

    Paste your malformed JSON into the input area on the left — whether it comes from an AI tool like ChatGPT, an API response, a log file, or a copy-paste from the web.

  2. 2

    The tool instantly detects the problems: trailing commas, single quotes, unquoted keys, markdown code fences, missing commas, JavaScript comments, unescaped control characters, and more.

  3. 3

    Click the Repair button or press ⌘↵ (Mac) / Ctrl+Enter (Windows) to automatically fix all detected issues.

  4. 4

    Review the detailed repair log below the output — each fix is listed with the repair strategy used, plus the exact line number and column where the change was made.

  5. 5

    Copy the repaired JSON with ⌘⇧C, download it as a .json file, or use the Code Generator to export the repair logic as ready-to-use Python, JavaScript, Go, or PHP code.

JSON Repair Tool Features

  • ✓

    Strips markdown code fences (```json ... ```) that AI tools and documentation sites wrap around JSON output.

  • ✓

    Fixes trailing commas after the last element in arrays and objects — the most common cause of JSON parse failures.

  • ✓

    Converts single-quoted strings to proper double-quoted strings for RFC 8259 compliance.

  • ✓

    Adds missing quotes around unquoted (bare) object property keys.

  • ✓

    Inserts missing commas between array elements or object properties.

  • ✓

    Extracts raw JSON from surrounding text — handles "Here is your JSON: {...}" wrappers and similar patterns.

  • ✓

    Fixes concatenated JSON objects where multiple independent JSON documents are joined together.

  • ✓

    Auto-closes brackets, braces, and quotes to repair truncated JSON from incomplete API responses or cut-and-paste errors.

  • ✓

    Unescapes control characters (tabs, newlines) that appear as literal escape sequences inside strings.

  • ✓

    Strips JavaScript-style comments (// single-line and /* multi-line */) that are not valid in standard JSON.

  • ✓

    Multi-language code generator: produces repair code in Python, JavaScript, Go, and PHP so you can integrate the logic directly into your own projects.

  • ✓

    Detailed repair log with line/column tracking for every change made, making it easy to audit exactly what was modified.

  • ✓

    Works entirely in your browser — no JSON data is ever sent to any server. Your data stays completely private.

Frequently Asked Questions

Is this JSON repair tool free?
Yes, DevFlow JSON Repair is completely free with no usage limits. All repairs run directly in your browser using pure JavaScript.
Is my JSON data safe?
Your JSON is processed entirely on your device. No data is ever transmitted to a server — everything stays in your browser.
What kinds of JSON errors can this tool fix?
It handles ten common JSON mistakes: markdown code fences, trailing commas, single-quoted strings, unquoted keys, missing commas, text-wrapped JSON, concatenated objects, truncated JSON, unescaped control characters, and JavaScript-style comments.
Can it fix JSON from ChatGPT or other AI tools?
Yes. AI assistants commonly wrap JSON in markdown fences (```json ... ```), include explanatory text outside the JSON block, or produce truncated output. JSON Repair handles all of these cases automatically.
What is the repair log?
The repair log lists every change made during the repair process, including the repair strategy used (e.g. fix-trailing-commas, add-missing-key-quotes) and the exact line and column where each change was applied. This makes the tool useful for auditing exactly what was modified.
Can it repair truncated JSON?
Yes. If your JSON is missing closing brackets, braces, or quotes at the end of a document, JSON Repair intelligently auto-closes them to produce valid output.
Does it handle JSON with JavaScript comments?
Yes. It strips both single-line (//) and multi-line (/* */) JavaScript-style comments, which are sometimes added to JSON-like config files but are not valid standard JSON.
What is the code generator?
The code generator produces ready-to-use functions in Python, JavaScript, Go, and PHP that replicate the same repair logic the tool uses. You can copy the code directly into your own projects to pre-process JSON before parsing.
How is this different from a JSON formatter?
A JSON formatter only prettifies valid JSON — it cannot process input that is syntactically invalid. JSON Repair first fixes the structural errors, then passes the result to the formatter. In other words, Repair handles broken JSON; Formatter only handles correct JSON.
Does it work offline?
Yes. All repair logic is bundled as pure JavaScript with the page. Once the page has loaded, the tool works without an internet connection.

Related Developer Tools

  • JSON FormatterPrettify, minify, and validate JSON data instantly.
  • JSON to TypeScript & Schema GeneratorGenerate TypeScript interfaces, Zod schemas, and Valibot schemas from JSON.
  • Text Diff CheckerCompare two text blocks and highlight exactly what changed.
  • AI Token CounterCount tokens and estimate API costs for major LLMs instantly.