Tiny Online Tools logoTiny Online Toolssearchツールを検索…grid_viewすべてのツール
ホームchevron_right開発者ツールchevron_rightJS 圧縮ツールJS 圧縮ツール

JS 圧縮ツール

コメントと空白を削除して JavaScript を圧縮します。

warningThis tool applies basic regex-based minification. For production use, a proper bundler such as esbuild, Terser, or Webpack is recommended for safe and thorough JS optimization.
890 bytes original536 bytes minified40% saved (354 bytes)
javascript

関連ツール

JavaScript フォーマッター

JavaScript フォーマッター

JavaScript コードを読みやすく整形します。

HTML 圧縮ツール

HTML 圧縮ツール

コメント、空白、冗長な属性を削除して HTML を圧縮します。

PDF 圧縮

PDF 圧縮

アップロードせずに PDF ドキュメントのファイルサイズを削減します。

画像圧縮

画像圧縮

目立った品質低下なしに画像ファイルサイズを削減します。

テキストをPDFに変換

テキストをPDFに変換

プレーンテキストをPDF文書に変換します。フォント、サイズ、ページレイアウトをカスタマイズできます。

文字頻度カウンター

文字頻度カウンター

テキスト内で各文字が何回現れるかを分析します。

絵文字へテキスト

絵文字へテキスト

変換 emojis へ their テキスト descriptions in colon, parentheses, or plain テキスト format.

apps

もっと見る

無料オンラインツールの全コレクションを見る。

圧縮 JavaScript Quickly Without a Bundler

Every byte matters when shipping JavaScript to users. Comments, whitespace, and extra フォーマットting add file size. Bundlers like Webpack and esbuild handle minification automatically, but sometimes you need quick, lightweight minification: removing comments from scripts you're embedding inline, reducing code snippets for documentation, or 圧縮ing scripts before shipping.

This JS Minifier strips comments and unnecessary whitespace, 圧縮ing JavaScript to the smallest readable フォーマット. It's not a full AST-level optimizer like Terser, but it's perfect for quick minification without heavyweight tooling.

What Gets Removed

Comments: Single-line (//) and multi-line (/* */) comments are stripped completely. License comments (often preserved by tools like Terser) are removed here, so if you need copyright headers, add them back post-minification or use a different tool.

Whitespace: Extra spaces, tabs, and newlines collapse. Line breaks only appear where JavaScript syntax requires them (after statements ending with semicolons).

フォーマットting: Code compacts to minimal space while remaining executable. This is different from code optimization—it doesn't rename variables or remove dead code. The resulting script is functionally identical.

圧縮ion Metrics

The tool shows you exactly how much you saved: bytes reduced and percentage 圧縮ion. For a 5KB script with lots of comments and indentation, you might see 30-40% reduction.

When to Use This vs. a Bundler

Use This Tool When:

  • You need quick minification without build setup
  • You're 圧縮ing small utility scripts
  • You're reducing code snippets for documentation or inline embedding
  • You want to see immediate minification results
  • You're working with simple scripts that don't need advanced optimization

Use a Bundler When:

  • You're shipping production code that needs AST-level optimization
  • You need variable renaming, dead code elimination, and advanced 変換s
  • You want scope analysis and aggressive optimizations
  • You're bundling multiple files with dependencies

Real-World 使用例

Inline Scripts: Minify small JavaScript snippets you're embedding in HTML documents or templates.

Third-Party Script Distribution: If you're publishing JS for other developers to use, minify it before release to reduce payload size.

Userscripts & Bookmarklets: 圧縮 JavaScript you're publishing on Gist or other platforms where smaller size helps with sharing.

Documentation Code Examples: Reduce code snippets in docs to fit better in display areas.

Quick Testing: Rapidly check how much minification would save before committing to a full build process.

Limitations to Know

This tool uses regex-based text 変換ation, not AST parsing. It won't:

  • Rename variables to shorter names
  • Eliminate unused code
  • Optimize control flow
  • Inline small functions

For production code needing these optimizations, use Terser, esbuild, or similar tools as part of your build pipeline.

Copy & Embed Immediately

Once minified, copy with one click. Paste directly into your templates, inline scripts, or distribution packages.

100% ブラウザ-Based

Minification happens locally in your ブラウザ. Your code never touches a server, so you can minify proprietary or sensitive scripts safely.