JavaScriptミニファイア
JavaScriptの基本的なminify(圧縮):コメントと不要な空白を取り除きます。本番環境では本格的なミニファイア(Terser、esbuild)をお使いください。
このツールの使い方
- 1
Paste or type your JavaScript into the input textarea.
- 2
The minified output appears instantly in the panel below as you type — there is no button to press.
- 3
Check the size readout (original length, an arrow, and minified length) to see how much was removed.
- 4
Select the text in the output box and copy it manually into your file.
JavaScriptミニファイアとは何ですか?
JavaScriptのminify(圧縮)は、バンドルサイズと解析時間を削減します。このツールは、空白とコメントの基本的な除去を行います。本番用のバンドルには、Terser、esbuild、SWCをお使いください。これらは名前の難読化(マングリング)やデッドコードの除去を行い、出力を劇的に小さく(しばしば60〜80%の削減)します。
よくある活用例
Quickly shrinking a short, comment-heavy snippet before pasting it into a tight inline <script> tag.
Stripping comments out of a code sample to share a compact version in a chat or gist.
Estimating roughly how much comment and whitespace overhead a small file carries before setting up a real build.
Cleaning up a hand-written configuration object or constant block that has no strings containing slashes.
Demonstrating to students or teammates what basic comment and whitespace removal looks like versus a real compiler.
Minifying a tiny utility function for a bookmarklet where pulling in a full toolchain is overkill.
よくある質問
Terserと比べてどうですか?▼
これで私のコードが壊れることはありますか?▼
関連ツール
JWTデコーダー
JSON Web Token(JWT)を瞬時にデコードします。お使いのブラウザ内で実行されるため、トークンがデバイスの外に出ることはなく、本番環境のシークレットでも安全に利用できます。
JSONフォーマッター&バリデーター
JSONをオンラインで整形、検証、minify(圧縮)します。すべてお使いのブラウザ内で動作するため、データがデバイスから外に出ることはありません。
XMLフォーマッター
XMLドキュメントを整形して読みやすくします。SOAP、サイトマップ、RSSフィード、設定ファイルに役立ちます。
Base64エンコーダー&デコーダー
文字列をBase64にエンコードしたり、Base64をテキストにデコードしたりします。あなたのプライバシーを尊重し、すべてブラウザ内で実行されます。
URLエンコーダー&デコーダー
テキストをURLセーフなエンコード(パーセントエンコーディング)に変換したり、その逆を行ったりします。クエリ文字列、リダイレクト、OAuthフローに役立ちます。
HTMLエンティティエンコーダー&デコーダー
特殊文字をHTMLエンティティ(&、<など)に変換したり、その逆を行ったりします。テキストを安全にHTMLへ埋め込むのに役立ちます。