JSON Formatter, Validator & Repair Tool
Format, minify, validate, and repair JSON instantly in your browser. Sort keys alphabetically, auto-format on paste, download as file, escape/unescape strings — free, no sign-up, 100% client-side.
最も完全な無料JSONフォーマッター
JSONフォーマッターの使い方
JSON Repairを使う場面
プライバシーとデータ管理
ほとんどのJSONフォーマッターは3つのことを行います:フォーマット・最小化・検証。このツールは7つを行います。基本に加えて、JSON Repair(末尾のカンマ・シングルクォート・JSコメント・引用符なしのキーを自動修正)・Sort Keys(アルファベット順・再帰的、差分確認に最適)・貼り付け時の自動フォーマット・埋め込み文字列リテラルのエスケープ/アンエスケープ・出力をファイルとして保存するダウンロードボタンがあります。すべてローカルで実行されます。アップロード・アカウント・ペイロードサイズの制限なし。
一部のサービスからのAPIレスポンス・手動編集された設定ファイル・JavaScriptオブジェクトリテラルはJSONのように見えますが、厳密には有効ではありません。最も一般的な問題:JavaScriptでは許可されているがJSONでは禁止されている末尾のカンマ・シングルクォートの文字列・インラインコメント・引用符なしのキー。Repairボタンは4つすべてを自動的に処理し、入力を書き直してフォーマットし、修正されたバージョンを表示します。
すべてはブラウザのJavaScriptエンジンで動作します。データはサーバーに送信されず、ログに記録されず、保存されません。認証情報・トークン・顧客データを含むAPIレスポンスを扱う際にこれは重要です。何でも貼り付けてください。デバイスを離れることはありません。
- JSONを入力ボックスに貼り付けます(またはサンプルをクリックして現実的な例を読み込みます)。
- フォーマットをクリックして読みやすいインデント付きのバージョンを表示します。2スペース・4スペース・タブインデントを選択できます。
- 最小化をクリックして本番環境での使用のためにすべての空白を削除します。
- JSONに一般的な構文エラー(末尾のカンマ・シングルクォート・JavaScriptコメント)がある場合はRepairをクリックします。
- Sort Keysをオンにして、すべてのネストレベルのオブジェクトキーをアルファベット順に並べ替えます。
- 入力に合わせて出力をリアルタイムで更新するには自動フォーマットを有効にします。
- コピーまたはダウンロードをクリックして出力を使用します。
よくある質問
- What is JSON formatting?
- JSON formatting (also called beautifying or pretty-printing) adds indentation, line breaks, and consistent whitespace to raw or minified JSON so it's human-readable. This tool formats instantly in your browser with 2-space, 4-space, or tab indentation — no upload required.
- Is my JSON sent to your servers?
- No. The JSON Formatter runs entirely in your browser using JavaScript. Your data is never uploaded, logged, or stored anywhere. This makes it safe to use with API responses containing credentials, customer records, or any sensitive data.
- What's the difference between Format and Minify?
- Format expands JSON with indentation and line breaks for human readability. Minify removes all whitespace to make the payload as compact as possible — useful for production APIs, HTML embedding, or reducing bandwidth. The stats bar shows you the size savings.
- How does the JSON Repair feature work?
- The Repair button auto-fixes the most common JSON errors: trailing commas before } or ], single quotes changed to double quotes, JavaScript-style // and /* */ comments removed, and bare unquoted object keys wrapped in double quotes. If the repaired JSON still fails to parse, the exact error position is shown.
- What does Sort Keys do?
- Enabling the Sort Keys toggle reorders all object keys alphabetically — recursively across every nested object. This is useful for diffing two JSON blobs, normalizing API responses for comparison, or enforcing consistent key order in configuration files.
- What does Auto-format do?
- With Auto-format enabled the output updates automatically as you type or paste — no need to click Format. When disabled, formatting only runs when you click a button, which is better for large payloads where live updates would be slow.
- What if my JSON is invalid?
- When JSON is invalid, the tool shows the parser's exact error message (often including the position of the problem). Common issues include trailing commas, single quotes instead of double quotes, JavaScript comments, and unquoted keys. Try the Repair button first — it fixes most of these automatically.
- What is JSON escape / unescape?
- Escape converts a plain text string into a JSON string literal — wrapping it in double quotes and escaping special characters like newlines (\n), tabs (\t), and backslashes (\\). Unescape does the reverse: it decodes a JSON string literal back to the raw text. This is useful when JSON is embedded inside another string.
- Can I download the formatted JSON?
- Yes. Click the Download button in the output panel to save the current output as a formatted.json file. This works for both formatted and minified output.
- Does this work offline?
- Yes. Once the page loads, all processing happens locally in your browser's JavaScript engine. You can disconnect from the internet and the tool keeps working.