PDF Mikata

如何把 JSON 壓縮成一行

釋出日期:2026 年 10 月 19 日|最後更新:2026 年 10 月 19 日|關於(日文)

要點
  • 貼上
  • 壓縮成一行
  • 複製

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.

步驟

  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%.

適合

示例

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.

小結

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

使用「整理並檢查 JSON」(免費)

搭配使用的工具

如果這篇教程對你有幫助,一點小小的打賞會讓我們非常開心。

打賞(300 日元)贈送禮物(亞馬遜心願單)

此工具的更多教程

檢視全部教程