JSON Formatter

JSON 入力

1

JSON 出力

設定

JSON の整形を開始

左側に JSON を入力するか、インポートでファイルから読み込んでください。

Beautify, minify, validate, escape, and unescape JSONChoose 2-space, 4-space, or sorted-key outputEverything stays local in your browser

JSON を整形・検証する手順

1ステップ 1 – JSON をオンライン整形ツールに貼り付ける/インポートする2ステップ 2 – 整形オプションを選ぶ3ステップ 3 – 整形結果とエラーを確認する4ステップ 4 – API/レスポンス/ログ向けにコピーまたはダウンロードする

A reliable formatter workflow is simple: paste the raw payload, choose whether you need readable or compact output, review parse errors if any, then copy, download, or continue into repair, table editing, or schema generation.

From one-line payload to readable structure

Expand raw JSON before you validate, diff, or edit it

A lot of real payloads come from logs, APIs, and queues as a single unreadable line. The formatter turns that into something you can inspect in seconds.

Raw input
1
{"orderId":"SO-1024","customer":{"name":"Maeve","tier":"gold"},"items":[{"sku":"A-1","qty":2},{"sku":"B-8","qty":1}],"paid":true}
Formatted output
1
{
2
"orderId": "SO-1024",
3
"customer": {
4
"name": "Maeve",
5
"tier": "gold"
6
},
7
"items": [
8
{
9
"sku": "A-1",
10
"qty": 2
11
},
12
{
13
"sku": "B-8",
14
"qty": 1
15
}
16
],
17
"paid": true
18
}

Use pretty output for review and debugging. Switch to minified output only when you need compact transport or storage.

3 practical formatter examples

These are the common cases where formatting pays off immediately during real development work.

API response

Turn a one-line response into something you can inspect

Useful when you need to confirm fields, nested objects, arrays, and unexpected values quickly.

入力 JSON
1
{"user":{"id":42,"name":"Maeve"},"roles":["admin","editor"],"flags":{"beta":true,"suspended":false}}
整形後の JSON
1
{
2
"user": {
3
"id": 42,
4
"name": "Maeve"
5
},
6
"roles": [
7
"admin",
8
"editor"
9
],
10
"flags": {
11
"beta": true,
12
"suspended": false
13
}
14
}

Readable structure is usually the fastest way to spot field-level mistakes in API data.

Config diff

Sort keys before comparing environment config

Stable key order makes diffs cleaner and reduces noise when reviewing configuration changes.

入力 JSON
1
{
2
"retry": 3,
3
"apiBase": "https://api.example.com",
4
"features": {
5
"betaCheckout": true,
6
"abTest": false
7
},
8
"timeout": 8000
9
}
整形後の JSON
1
{
2
"apiBase": "https://api.example.com",
3
"features": {
4
"abTest": false,
5
"betaCheckout": true
6
},
7
"retry": 3,
8
"timeout": 8000
9
}

Sorting is useful when your real goal is comparison rather than human-friendly business ordering.

Escaped payload

Unescape a JSON string before editing it

Logs and message systems often store JSON inside strings. Unescape it first, then keep working on the actual structure.

入力 JSON
1
"{\"event\":\"login\",\"user\":{\"id\":42,\"name\":\"Maeve\"},\"success\":true}"
整形後の JSON
1
{
2
"event": "login",
3
"user": {
4
"id": 42,
5
"name": "Maeve"
6
},
7
"success": true
8
}

If the payload is full of backslashes, unescaping is usually the first useful step.

  1. 01

    Tutorial Step

    ステップ 1 – JSON をオンライン整形ツールに貼り付ける/インポートする

    Start with the original payload. You do not need to clean up spacing or line breaks first.

    • 任意のソース(API レスポンス、設定ファイル、ログなど)から生の JSON を左側のエディターに貼り付けます。
    • または「インポート」で、ファイル、URL、サンプルデータから JSON を読み込みます。
    • このツールはオンライン JSON 整形ツールとして、乱れた JSON を素早く整えられます。
    • Single-line JSON is fine. The formatter can expand it into a readable structure for you.
    • When several people need to review the same payload, keep the original input intact and format it here instead of editing it by hand first.
  2. 02

    Tutorial Step

    ステップ 2 – 整形オプションを選ぶ

    Readable JSON and compact JSON solve different problems. Pick the mode that matches what you need next.

    • インデント幅を選択して整形します(2 スペース、4 スペース、またはコンパクト)。
    • 必要に応じてキーをアルファベット順に並べ替え、payload 間で構造を正規化します。
    • API、保存、または本番向けにコンパクトな JSON が必要な場合は、ミニファイ出力に切り替えます。
    • Use Escape when you need a JSON string literal, for example inside logs or nested config values.
    • Use Unescape when the input is an escaped JSON string and you want the plain text back.
  3. 03

    Tutorial Step

    ステップ 3 – 整形結果とエラーを確認する

    The output area is both a result view and a fast feedback loop. Valid JSON renders immediately; invalid JSON shows an actionable error.

    • 右側で、シンタックスハイライトと一貫したインデント付きの整形済み JSON を確認します。
    • パースエラーに注意します(例:カンマや引用符の不足)。
    • 整形しながら、簡易的な JSON 構文チェックとしても使えます。
    • If the payload is too broken to fix quickly, move it straight to the Repair tool.
    • When the data contains nested escaped JSON, unescape it first so the real structure becomes visible.
  4. 04

    Tutorial Step

    ステップ 4 – API/レスポンス/ログ向けにコピーまたはダウンロードする

    Once the JSON is clean, use it as the working copy for the next step instead of repeating the cleanup elsewhere.

    • 「コピー」で整形済み JSON をクリップボードに送ります。
    • 結果を .json ファイルとしてダウンロードし、API リクエスト/レスポンスやログのスナップショットに利用できます。
    • 同じ整形済み JSON を、ドキュメントやコード例のためのクリーンな参照として再利用します。
    • Move the cleaned JSON into the table editor when field-level review is easier in rows and columns.
    • Generate a schema from the cleaned payload when the next step is validation, documentation, or code generation.

A common formatter workflow

1

Paste the raw payload into the formatter and expand it into readable JSON first.

2

If the parser fails, jump to the error or move the payload into Repair.

3

Once the structure is valid, choose beautified, minified, escaped, or unescaped output based on the next task.

4

Apply the output back to input if the cleaned result should become your new working copy.

5

Continue into the table editor, compare tool, or schema generator when formatting is no longer the bottleneck.

Putting the formatter at the front of the workflow usually saves time later because every downstream tool receives cleaner JSON.

初心者向けクイックヒント

JSON のエラーは、カンマ不足、余分な末尾カンマ、または二重引用符の代わりに単一引用符を使うことが原因であることが多いです。
すべてが 1 行に詰まっている場合は、先に整形してから、上に表示されるエラーを修正します。
デバッグ中は整形済み JSON を使い、本番の payload ではミニファイ JSON に切り替えます。

関連する JSON ツール

  • 整形の前後で JSON を検証し、構文エラーを早めに見つけます。
  • パースできない壊れた JSON は先に修復し、その後に整形します。
  • クリーンな JSON からスキーマと型を生成し、検証と型付きコードに活用します。

よくある質問

JSON の整形とは何ですか?

JSON を整形すると、適切なインデント、改行、空白が付与され、読みやすく理解しやすくなります。

インデントは変更できますか?

はい。2 スペース、4 スペース、またはコンパクト(ミニファイ)を選べます。

整形でデータは変わりますか?

いいえ。表示形式が変わるだけで、構造と値はそのままです。

大きな JSON ファイルも整形できますか?

はい。大きな JSON でも効率的に処理できますが、非常に大きい場合は少し時間がかかることがあります。

What is the difference between formatting and validation?

Formatting focuses on readability, while validation focuses on syntax correctness. This page does both in one flow.

Is my JSON uploaded to a server?

No. Formatting, validation, escaping, and unescaping all run locally in your browser.