JSON
JSON Formatter / Minify / Validator
JSON の整形(スペース2つのインデント)・圧縮・検証をブラウザ内で完結。
JSON Formatter turns any JSON into a readable, indented form, compresses it into a single compact line, or checks it for syntax errors. Everything runs in your browser — nothing you paste is sent anywhere.
How to use it
- Format: paste JSON into the input — a 2-space indented result appears immediately.
- Minify: switch to Minify mode to get compact JSON with no whitespace, ready to embed in code or send over the network.
- Validate: if the JSON is invalid, the tool points to the exact line and character where the syntax error occurs.
Common uses
- Reading an API response that arrived as one long unbroken line.
- Checking configuration files (package.json, tsconfig.json, etc.) before a commit.
- Minifying JSON before pasting it into an environment variable or a one-line config.
Things to keep in mind
Formatting never changes data types or key order — only the whitespace and line breaks around values.
Valid JSON doesn't allow trailing commas, comments, or single quotes — if your input has those, run it through JSON Repair first.
よくある質問
このJSONフォーマッターは何をするツールですか?
JSONを2スペースのインデントで整形したり、圧縮(minify)したり、妥当性を検証したりできます。すべてブラウザ内で完結します。
貼り付けたデータはサーバーに送信されますか?
いいえ、処理はすべてブラウザ上のJavaScriptで行われ、入力したJSONがサーバーに送信されることはありません。
一見正しそうなJSONなのにエラーになるのはなぜですか?
よくある原因は、オブジェクトや配列の最後の要素の後ろに付いたトレイリングカンマです。一部の言語では許容されますが、JSONの仕様では無効です。なお、圧縮(minify)はトークン間の空白のみを取り除き、文字列値の中の文字には手を加えません。
JSON5やJSONCは標準のJSONと何が違いますか?
これらは拡張形式で、コメント・トレイリングカンマ・クォートなしのキーを追加で許容します。厳密なJSONバリデーター(このツールなど)は、そのようなテキストを正しく拒否します — JSON5やJSONCを明示的にサポートする別のパーサーが必要です。
整形はデータの型(数値など)を変更しますか?
いいえ、整形と圧縮(minify)は値の前後の空白や改行を並べ替えるだけです。数値・文字列・真偽値・nullは元のまま保持されます。