ツール ガイド
developer 無料 サインアップ不要

JSONミニファイアー & ビューティファイアー

シンタックスハイライト付きでJSONをフォーマットするか、空白を除去してミニファイします — リアルタイム検証とサイズ統計付き。

ツールを読み込み中…

このツールについて

ビューティファイモードとミニファイモードを切り替えます:ビューティファイモードはJSONを2スペースまたは4スペースのインデントとカラーコードのシンタックスハイライト付きでフォーマットします。ミニファイモードはプロダクションペイロードのために不要な空白をすべて除去します。変換は入力しながらリアルタイムで行われます。ツールは元のサイズ、出力サイズ、変化率を報告し、JSONエラーは正確な行番号と列番号付きでフラグが立てられます。

使い方

  1. 1 左の入力パネルにJSONを貼り付けるか入力してください。
  2. 2 「ビューティファイ」をクリックしてインデントとシンタックスハイライト付きでフォーマットするか、「ミニファイ」をクリックして空白を除去してください。
  3. 3 サイズ統計バーを確認して元のサイズ、出力サイズ、変化率を確認してください。
  4. 4 エラーがある場合は、エラーバナーの行/列のヒントを読み、入力パネルでJSONを修正してください。

What minification actually removes

JSON minification is the process of stripping every byte that a parser does not need. Human-readable JSON is padded with whitespace for our benefit: line breaks after each property, two or four spaces of indentation per nesting level, and a space after every colon and comma. None of that affects the data. A minifier parses the JSON into a real object and then re-serialises it with zero formatting, so { "name": "Alice", "age": 30 } spread across several indented lines collapses to the single string {"name":"Alice","age":30}. The values are byte-for-byte identical; only the cosmetic spacing is gone.

This tool does both directions. Minify produces the compact form. Beautify does the reverse — re-indenting with your choice of 2 or 4 spaces and syntax-highlighting keys, strings, numbers, and literals — for when you receive a dense blob and need to read it.

Where the savings come from — a worked example

Indentation is the biggest source of bloat, and it compounds with depth. Consider a config with nested objects:

{
  "server": {
    "host": "localhost",
    "port": 8080
  }
}

That pretty version is 64 bytes. Minified, it becomes {"server":{"host":"localhost","port":8080}} — 43 bytes, a 33% reduction. The tool measures this for you: after each operation a stats line shows input size, output size, and the percentage change. Minifying turns the percentage green and negative (smaller); beautifying turns it red and positive (larger), because re-adding indentation grows the file. The byte counts use UTF-8 encoding, so multi-byte characters are counted accurately rather than as one byte each.

FormBytes (example)Use it for
Pretty, 4-spaceLargestReading, code review, diffs
Pretty, 2-spaceMediumA compromise for committed config files
MinifiedSmallestNetwork transfer, storage, embedding

Why minified JSON matters in production

On a busy API, those saved bytes repeat on every single request. Trimming 20–40% off each JSON response reduces bandwidth costs and shortens transfer time, which is felt most on mobile connections. Minified JSON is the right form for anything that travels over the wire or gets stored at scale: API payloads, data embedded in HTML, records in a cache or database column, and configuration shipped inside a bundle. In real deployments minified JSON is then usually compressed with gzip or brotli on top, and the two stack — minification removes structural whitespace, compression removes statistical redundancy.

Practical tips

  • Minify for machines, beautify for humans. Commit and ship the compact form; expand it only when you need to read or debug it. This tool lets you flip between the two instantly.
  • Validate while you minify. Because the tool parses before re-serialising, invalid JSON cannot be minified — a malformed input is caught here, which doubles the tool as a quick syntax check.
  • Use the error location. When parsing fails, the banner reports the line and column of the problem (derived from the parser's character position), so you can jump straight to the stray comma or unquoted key.
  • Pick 2-space for diffs. If the JSON lives in version control, 2-space beautified output keeps line diffs readable while staying smaller than 4-space.

Common mistakes

  • Expecting key names or values to shrink. Minification only removes whitespace; it never renames keys or alters data. The string "description" stays exactly that. If you need smaller keys, that is a schema change, not minification.
  • Trying to minify JSON with comments or trailing commas. Standard JSON allows neither. A trailing comma or a // comment will fail parsing — strip those first.
  • Assuming minified JSON is unreadable forever. It is fully reversible. Paste any compact JSON back in and Beautify restores readable, highlighted formatting with no data loss.
  • Worrying about precision. Re-serialising can normalise number formatting (for example, dropping a redundant trailing zero), but the numeric value is preserved.

Everything runs in your browser

Your JSON is parsed and re-serialised entirely on your own device using the browser's native JSON engine — nothing is uploaded, logged, or stored on a server. That makes it safe to minify configuration containing internal hostnames, tokens, or proprietary data. You can confirm it by going offline: both Minify and Beautify keep working, because there is no network step involved.

よくある質問

{# Alpine.js — self-hosted. (The previous jsdelivr CDN tag had a stale SRI integrity hash, so the browser refused to run it and window.Alpine was never defined — silently breaking every FAQ accordion and Alpine tool.) #}