Skip to content
cosmodev ~/tools/json-repair

JSON 복구 도구

AI & Agents

깨진 JSON을 복구합니다. 후행 쉼표, 작은따옴표, 따옴표 없는 키, 주석, Python 상수, BOM, 잘린 문서를 다루고, 깔끔하게 정렬된 JSON과 적용된 복구 전체 목록을 제공합니다. 브라우저에서만 전부 실행됩니다.

예시:
복구된 JSON
깨진 JSON을 입력하거나 붙여넣으면 복구돼요.

(문서는 영어)

What it does

Turns broken-but-salvageable JSON back into valid JSON. Paste text that a strict parser rejects - trailing commas, single quotes, unquoted keys, // or /* */ comments, Python’s True/False/None, a copied-in BOM or zero-width characters, or a document cut off mid-way - and get clean, pretty-printed JSON back. Every repair pass that fired is listed by name, so you can see exactly what was changed and why. If the input already parses, the tool says so and simply pretty-prints it. Everything runs locally in your browser; nothing you paste is sent anywhere.

This is the daily companion of anyone who moves JSON between languages and tools: LLM output that slipped into Python or JavaScript habits, config files pasted out of a notebook, log lines truncated mid-object.

How to use it

  1. Paste broken JSON into Broken JSON, or tap Sample for a document that exercises several repairs at once. Clear empties the box.
  2. Tap a chip below the input to try a headline case: trailing comma, single quotes, truncated array, unquoted keys.
  3. Read the badge: Repaired (green, changes were made), Valid JSON (green, input already parsed), or Unrepairable (red, the parser error is shown).
  4. When repaired, read Repairs applied (N) - one bullet per pass that changed your text - then copy the result with Copy repaired JSON.
  5. Copy share link encodes your input in the URL (?j=...), so a link reproduces the exact view.

Examples

A trailing comma:

{"host": "localhost", "port": 8080,}

Result: Repaired, 1 repair applied (Removed trailing commas), output:

{
  "host": "localhost",
  "port": 8080
}

A Python-flavored dict (single quotes plus True):

{'name': 'CosmoDev', 'open': True}

Result: Repaired, 2 repairs applied (Converted single quotes to double quotes, Converted Python constants (True/False/None)), output:

{
  "name": "CosmoDev",
  "open": true
}

A truncated array (log line cut off mid-object):

{"list": [1, 2,

Result: Repaired, 1 repair applied (Closed truncated brackets), output:

{
  "list": [
    1,
    2
  ]
}

Good to know

  • Passes, in order: invisible characters (BOM / zero-width) → single quotes → comments → unquoted keys → Python constants → trailing commas → truncated brackets. Each pass only fires when it changes something.
  • Repair is best-effort: a document truncated mid-key ({"na) can end in an invalid token and stays Unrepairable - the parser’s error tells you where. Repair also never invents missing data: a value cut off mid-number stays exactly as written.
  • ?j=... links reproduce the exact view; very large documents make long URLs.
  • Private: the tool runs 100% client-side - safe for configs, credentials, and API payloads.
  • Related tools: JSON Validator, JSON Formatter, JSON Minify.
소스 코드14개 언어

100% 클라이언트 측 · 데이터는 브라우저 밖으로 나가지 않습니다. 도움이 되었나요? 팀원에게 공유해 보세요.