線上格式化無效 JSON,並在過程中自動修復尾隨逗號、缺少引號、註解、Python 風格字面值等常見語法問題。
相關
A directory of JSON parser error messages and the article that explains each one — start with a strict validator, then drill into the specific syntax problem.
物件最後一個屬性或陣列最後一個項目後面的尾隨逗號,在部分 JavaScript 場景下允許,但在 JSON 中並不合法。
JSON 字串與物件鍵必須使用雙引號。單引號值常見於 JavaScript 片段、類似 Python 的輸出,以及 LLM 回應中。
一般的 JSON 格式化工具只在輸入已經合法時才能運作。fixjson.org 是一個帶自動修復的 JSON 格式化工具:它會先修復常見的語法錯誤,再以可讀的縮排格式化清理後的 JSON。當負載來自日誌、API 回應、手動編輯的設定或 AI 輸出時,用它在線上格式化無效的 JSON。
同一個工具也是 json beautifier、online json beautifier、 json prettifier、json prettify、json tidy online、 json decoder,以及 json object formatter —— 都是同一件事的不同稱呼:解析(json decode)、修復、再以縮排重新輸出。無論你叫它 prettify json、prettier json、json beautify、 json prettier、json formater、code formatter、 code beautify,或者 code beautification,輸出都是一樣的:嚴格、格式化的 JSON,符合標準 json file format。它是一個線上 JSON 格式化工具(也常被搜尋為 json format online、 online json editor、.json editor,或 jsoneditoronline),也是一個輕量的線上 JSON 編輯器 —— 不需要上傳,也不需要註冊帳號。無論你搜的是 code beautifier、code formatter、 json beautifier online、json crack、edit json、 json edit online、.json decoder、json formatter and validator、 json online formatter、json fixer / fix parser,或者只是 json beautifier(有時拼成 json beutify、prettify),它都是同一個工具。
工具內部會在格式化前先跑一遍 JSON parse —— 所以它涵蓋了同一件事的各種說法:json parse、json object parse、 parse from json、parsing in json、json to parse,以及 json parse json。如果解析失敗,修復步驟就會介入;如果兩步都成功,你看到的格式化輸出就跟你親手寫出來的一樣。
'value' 轉換為 "value"{ name: "Ada" } 的裸識別字自動補上雙引號} 或 ] 前的尾隨逗號True、False、None 替換為對應的 JSON 字面值// 行註解與 /* */ 區塊註解```json 與結尾的 ```0xFF 轉換為十進位