JavaScript 压缩工具 — Uttir
Skip to main content

JavaScript 压缩工具

快速压缩 JS:去除注释、压缩空白。适合处理可信的简单代码片段。

JavaScript 压缩工具 — A lightweight JavaScript minifier that strips block and line comments and collapses whitespace. Useful for one-off scripts, bookmarklets, and snippets where you want a quick size reduction without setting up a build pipeline.

Your JavaScript is processed locally and never sent over the network.

Was JavaScript 压缩工具 useful?

JavaScript 压缩工具是什么?

A lightweight JavaScript minifier that strips block and line comments and collapses whitespace. Useful for one-off scripts, bookmarklets, and snippets where you want a quick size reduction without setting up a build pipeline.

CAUTION: This is a syntactic minifier, not a real parser. It does not understand strings, template literals, or regular expressions, so it can mangle code that contains // or /* * / inside those constructs. For production code, use Terser, esbuild, or SWC.

使用方法

  1. Paste your JS

    A snippet, a function, or a small module.

  2. Read the minified output

    Comments and excess whitespace are stripped.

  3. Copy

    Grab the result for use elsewhere.

示例

Comment stripping

Block and line comments go away.

/* greet */ const greet = (name) => {
  console.log("hi", name); // say hi
};

结果: const greet = (name) => { console.log("hi", name); };

Whitespace collapse

Multiple spaces and newlines become one.

const    a  =   1;

结果: const a = 1;

常见问题

相关指南

相关工具

Last reviewed: 2026-11-21