DataPurge.dev

LLM Broken JSON Repair (ChatGPT / OpenAI / Claude)

Strip ```json markdown fences, inline comments, smart quotes, and trailing commas from AI-generated JSON responses instantly.

Zero tracking • Runs entirely in your browser
Raw / Dirty Input
162 chars•9 lines•166 B
Sanitized OutputClean Text
162 chars•9 lines•162 B(-2%)
Fixes applied:
✓ 8 smart quotes normalized to ASCII
Live Telemetry & DiagnosticsLive
Sanitizer & Repair
Data Processed
166 B
162 chars
Errors Fixed
8
Syntax & hidden chars
Size Optimization
-2%
4 B saved
Processing Time
< 1 ms
Local engine
Privacy Score
100 / 100
Zero data leaves browser

Repairing Malformed JSON Outputs from Large Language Models

Even with structured output modes, Large Language Models (LLMs) like ChatGPT, OpenAI GPT, Claude, and Gemini frequently wrap JSON responses in Markdown fences or slip in JavaScript-style comments and trailing commas.

Why does this error occur?

LLMs are trained on billions of lines of human-written tutorials, GitHub READMEs, and JavaScript configs. As a result, they naturally mimic human habits: wrapping payloads in ```json ... ``` code blocks, adding explanatory // comments inside JSON objects, leaving trailing commas after array items, or mixing in curly typographic quotes (“ ”).

When your application or test script passes that raw LLM completion directly to JSON.parse(), the parser crashes immediately because strict JSON forbids code fences, comments, unquoted keys, and trailing commas.

How is it solved?

Paste the raw AI response directly into DataPurge above. The repair engine automatically strips leading and trailing Markdown code fences (```json, ```), removes // single-line and /* */ block comments, converts smart quotes into ASCII double quotes, and repairs unquoted keys or trailing commas.

Within milliseconds, you get strictly valid, formatted JSON ready to drop into Postman, your database seeder, or your frontend mock files.

Why should you use 100% Client-Side (Zero-Telemetry)?

LLM prompts and completions often contain proprietary business logic, customer support transcripts, or internal codebases. Passing AI outputs through a third-party server-side JSON fixer creates an unnecessary second point of data exposure.

DataPurge runs 100% in your browser memory with zero network transmission, keeping your AI workflows private and instantaneous.

No Compiler CrashesStrips zero-width spaces (\u200B) and curly quotes copied from Notion, Slack, or ChatGPT that secretly break your code.
100% In-Browser PrivacyNo API calls, no backend, no analytics trackers. Your proprietary code and tokens never touch any server.
Multi-Format EngineEffortlessly switch between JSON, YAML, XML, and CSV with automatic structure detection and clean syntax formatting.

Specialized Developer Utilities & Guides

All-in-One Sanitizer