PlayWithJSON

Broken JSON Repair & Fixer

AI & LLM JSON Healer

Automatically fix broken, malformed, or truncated JSON from ChatGPT, Claude, and APIs.

Malformed JSON
Sample:
Healed & Valid JSON
Fixes (1):Removed Markdown codeblock wrapper (```json ... ```)
{
  "status": "processing",
  "model": "gpt-4o",
  "results": [
    {
      "id": 1,
      "title": "Quantum Computing",
      "tags": [
        "physics",
        "hardware"
      ]
    }
  ]
}

Broken JSON Repair & Fixer Online - Heal Malformed AI & LLM JSON

Automatically fix and repair broken, malformed, or truncated JSON generated by ChatGPT, Claude, and local LLMs directly inside your browser.

Handles missing closing brackets and braces, removes trailing commas, converts Python True/False/None to valid JSON, quotes raw identifiers, and strips Markdown code blocks in real time.

{}

Why Use PlayWithJSON?

  • Auto-balances unclosed braces and brackets from truncated AI outputs
  • Converts single quotes into compliant double quotes
  • Removes invalid trailing commas from objects and arrays
  • Normalizes Python True, False, and None into true, false, and null
  • 100% private, client-side execution with zero server transmission

Key Features of Broken JSON Repair

Bracket & Brace Balancing

Automatically detects and closes unclosed curly braces and square brackets in the proper nested order.

Quote Normalization

Converts single-quoted keys and values into valid standard double quotes while preserving internal apostrophes.

Python Literal Coercion

Translates Python dictionary literals (True, False, None, NaN) into RFC-compliant JSON primitives.

Markdown Code Block Stripping

Strips markdown code fences (```json ... ```) automatically when copying responses from ChatGPT.

Comment & Comma Cleaning

Eliminates illegal trailing commas and strips single-line and multi-line comments.

Instant Copy & Export

Copy the healed, beautified JSON immediately or download it as a clean repaired.json file.

How to Fix Broken JSON Online

1

Paste Malformed JSON

Paste the broken or truncated JSON snippet into the left editor panel.

2

Automatic Repair

The healer instantly balances braces, quotes keys, removes trailing commas, and fixes literals.

3

Review Applied Fixes

Check the list of repaired issues shown in the status pill badge.

4

Copy or Download

Copy the valid, formatted JSON output to your clipboard or download the file.

Broken JSON Repair Example

Malformed Input (Truncated + Single Quotes + Python)
{ 'user_id': 101, 'is_admin': True, 'tags': ['developer', 'ai',
Repaired Output (Valid JSON)
1{
2 "user_id": 101,
3 "is_admin": true,
4 "tags": [
5 "developer",
6 "ai"
7 ]
8}

Supported Repair Heuristics

Broken JSON
1{
2 name: 'PlayWithJSON',
3 active: True,
4}
Syntax error: unquoted key, single quotes, Python True, and trailing comma
Repaired JSON
1{
2 "name": "PlayWithJSON",
3 "active": true
4}

Supported Repair Rules

Unclosed braces balancing (EOF auto-close)
Unquoted key identifier quoting
Single quotes to double quotes replacement
Trailing commas removal before closing brackets
Python True, False, None to true, false, null
Markdown fence stripping (```json)
Empty property colon null filling
Comment stripping (// and /* */)
Real-time repair badges and changelog
100% private in-browser processing
Frequently Asked Questions

Frequently Asked Questions about JSON Repair

Large language models frequently hit output token limits resulting in truncated responses with unclosed braces. They also occasionally use single quotes or Python boolean keywords (True/False) instead of strict JSON specification syntax.

More JSON Developer Tools

View All Tools

JSON Formatter

Format, validate and inspect JSON data

JSON5 Formatter

Format and validate JSON5 with comments

JSON ↔ JSON5

Convert between JSON and modern JSON5

JSON to TypeScript

Generate TypeScript interfaces from JSON

JSON to Zod

Generate Zod schemas from JSON

Text to JSON

Convert text and schemas into structured JSON

JSON Sorter Online

Sort JSON keys alphabetically and order arrays

JWT Decoder Online

Decode JWT header, payload and expiration

JSON Stringify Online

Escape quotes and stringify or unescape JSON

Mock JSON Generator

Generate realistic mock data for APIs and testing

JSON to CSV

Export structured JSON arrays into CSV spreadsheets

JSONPath Tester

Query and filter JSON data with path expressions

JSON Schema Generator

Generate JSON Schema from sample JSON

JSON Diff & Compare

Compare two JSON objects and find differences

JSON ↔ YAML

Convert JSON/JSON5 to YAML and back with comments

JSON ↔ XML

Convert JSON to XML and XML to JSON with attributes

YAML to CSV

Convert YAML lists and objects into spreadsheets

CSV to JSON / JSON5

Convert CSV/TSV to JSON or JSON5 with type parsing

JSON to BigQuery

Generate BigQuery Schema JSON and CREATE TABLE DDL

JSON to GraphQL

Generate GraphQL SDL types, queries, and inputs

JSON to MySQL

Generate MySQL CREATE TABLE DDL and INSERT queries

JSON to PostgreSQL

Generate PostgreSQL CREATE TABLE DDL, JSONB and INSERTs

JSON Flattener

Flatten nested JSON to dot notation or unflatten back

JSON Tree Visualizer

Interactive SVG mindmap graph and collapsible node tree

JSON Minifier Online

Compact and compress JSON by stripping whitespace

JSON Token Counter

Calculate LLM tokens (GPT-4o, Claude) and API costs

Broken JSON Repair

Automatically heal broken and truncated AI/LLM JSON