PDFのミカタ

JSONを1行にまとめる方法

公開日:2026年10月19日|最終更新:2026年10月19日|運営者情報

この記事のポイント
  • 貼る
  • まとめる
  • コピーする

読みやすく整えたJSONを、今度は、通信量を減らしたり、1行で扱ったりするために、逆に詰めたいことがあります。JSONを整える・チェックする の「1行にまとめる」で、空白と改行を取り除けます。

手順

  1. 「整える前」に、JSONを貼り付けます。
  2. 「1行にまとめる」を押します。
  3. 「整えた後」に、1行になったJSONが出ます。
  4. 「結果をコピー」でコピーして使います。
空白と改行が消えるだけで、データの中身は変わりません。

1行にまとめるメリット

整える・まとめる、の使い分け

注意すること

容量が減る目安

空白と改行が多いほど、効果が大きくなります。字下げの深いJSONでは、2〜3割小さくなることもあります。

向いている場面

例

読みやすく整えた設定のJSONを、環境変数に入れたかった。貼り付けて「1行にまとめる」を押し、結果をコピーして設定した。

つまずきやすい点

よくある質問

1行にしたJSONを、読みやすく戻せますか?

はい。「整える」を押すと、字下げされます。

まとめ

機械に渡すなら1行に、人が読むなら整える。元のJSONも、残しておきましょう。

JSONを整える・チェックするを使う(無料)

あわせて使えるツール

この解説が役に立ったら、応援してもらえるとうれしいです。

応援する(300円)ほしい物リストで応援

同じツールの、ほかの解説

解説の一覧を見る

How to Minify JSON

Published: Oct 19, 2026 | Updated: Oct 19, 2026 | About (Japanese)

Key points
  • Paste
  • Minify
  • Copy

JSON you've formatted for reading sometimes needs to be packed back, to cut data volume or handle it on one line. "Make one line" in Format and Validate JSON removes spaces and line breaks.

Steps

  1. Paste the JSON into "Before".
  2. Press "Make one line".
  3. The one-line JSON appears under "After".
  4. Copy with "Copy result" and use it.
Only spaces and line breaks vanish. The data's contents don't change.

Benefits of one line

When to format and when to compress

Cautions

How much smaller

The more spaces and line breaks, the bigger the effect. Deeply indented JSON can shrink by 20–30%.

Good for

Example

Wanted to put formatted configuration JSON into an environment variable. Pasted it, pressed "Make one line", then copied the result and set it.

Common stumbling blocks

Frequently asked questions

Can one-line JSON be turned back into readable form?

Yes. Pressing "Format" indents it.

Summary

One line for machines, formatted for people. Keep the original JSON too.

Use "Format and Validate JSON" (free)

Tools that go well with this

If this guide helped, a small tip would mean a lot.

Send a tip (¥300)Send a gift (Amazon wishlist)

More guides for this tool

See all guides