Browse all 103 browser-based tools (103 currently marked free), or tell us what useful utility we should build next.
Reduce supported JavaScript whitespace and comments in a pasted snippet. Review the output and its behavior before including it in a project.
This text-based minifier can change JavaScript behavior. Keep the original and test the output before use; use a parser-based build tool for production code.
Minify your JavaScript in real-time as you paste or type code.
See exactly how many bytes you save with detailed compression statistics.
All processing happens locally. Your code never leaves your browser.
This workspace removes comments and non-essential whitespace from pasted JavaScript snippets to produce a compact script string for quick inspection. This browser utility is not a replacement for a parser-based production build pipeline. JavaScript syntax, automatic semicolon insertion, and regular-expression literals can make text-based rewriting unsafe. Test the transformed code and retain the original source.
toolk-minified.js.Minification reduces file size without changing behavior. Across most real-world bundles, whitespace removal and identifier mangling account for roughly 95% of the savings — not exotic code transforms. Production tools such as Terser parse your code into an Abstract Syntax Tree, then mangle local variable names, fold constants, and run dead-code elimination, reaching reductions up to about 80%.
This Toolk minifier is the lightweight, browser-side tier of that pipeline. It performs safe textual minification only: it deletes // line comments and /* */ block comments, removes blank lines and indentation, collapses repeated spaces and tabs, and strips most spaces around operators — while preserving the spaces that keywords like return, typeof, and const require. It does not rename variables or remove unused code, so the output stays recognizable.
"Minification removes whitespace, comments, and redundant characters while variable names stay the same; uglification goes further by renaming variables and functions to the shortest possible names."— The distinction this tool follows: it minifies, it does not mangle.
One detail build tools add that this one removes: a source map comment. Bundlers append a //# sourceMappingURL=app.js.map line so DevTools can map minified code back to your source (see the MDN source map glossary). Because this minifier strips all comments, any sourceMappingURL or /*! license */ banner is removed too — add those after minifying.
Comment + whitespace removal
// add two numbers function add(a, b) { return a + b; }
→ function add(a,b){return a+b;}
Block comment dropped
/* config */ const MAX = 100;
→ const MAX=100;
Edge case · comment marker inside a string
The comment stripper is regex-based, not a parser. A // inside a string literal — for example const note = "visit example.com // now"; — gets cut from // onward, breaking the string. A leading https:// is protected (the regex skips // after a colon), but other in-string or in-regex // sequences are not. Review output that contains // inside strings or regex literals.
These rows reflect the actual transforms in this tool, contrasted with a full AST compressor like Terser. Use it to decide whether browser-side minification is enough or you need a build step.
| Transform | This Toolk minifier | AST tool (Terser) |
|---|---|---|
| Line & block comments | Removed | Removed |
| Whitespace & blank lines | Removed | Removed |
| Spaces around operators | Collapsed | Collapsed |
| Identifier / variable mangling | Not done | Done |
| Dead-code elimination | Not done | Done |
| Typical raw size cut | ~20–60% | up to ~80% |
Minifying is not a substitute for server compression — the two stack. Minification rewrites the source to fewer bytes; Gzip and Brotli then compress those bytes in transit and the browser decompresses them. Minified JavaScript actually compresses better, because there is less redundant whitespace for the algorithm to encode. In practice, minify + Brotli (or Gzip) can shrink a payload by roughly 80–90% versus the original source, and Brotli typically beats Gzip by about 15–20%.
Practical takeaway: use this tool for quick, transparent comment-and-whitespace minification, keep server compression on, and reach for a build-time AST tool only when you need identifier mangling or dead-code elimination. The savings figure shown here is raw bytes (measured as the UTF-8 Blob size), so your over-the-wire number after Brotli will be smaller still.
Shrink stylesheets the same way
HTML FormatterTidy and indent messy markup
JSON FormatterValidate and pretty-print JSON data
HTML to JSXConvert HTML into React JSX
HTML Entity ConverterEncode and decode HTML entities
Image CompressorCut image weight for faster pages
Token CounterCount LLM tokens in your code
Markdown TOCBuild a table of contents fast
Meta Tag PreviewerPreview SEO and social tags
Open Graph GeneratorGenerate OG meta tags
Favicon GeneratorCreate favicons in every size
Word CounterCount words and characters
All ToolsBrowse the full Toolk toolbox
Last updated: September 15, 2026 · Runs 100% in your browser — no uploads, tool input is not sent to Toolk.
No — and that is deliberate. It is a comment-and-whitespace minifier, not an AST transformer: identifiers keep their names and unreachable branches stay in place, so behavior is predictable without a source map. For mangling and tree-shaking, use a build-time tool such as Terser or esbuild.
It can, rarely. Because the engine is regex-based rather than parser-based, a comment marker inside a string or regex literal can be mistaken for a real comment, and spacing changes around / can affect regex literals. Always test the output before shipping anything critical.
No. The transformation runs locally in your browser tab, and Toolk’s page analytics do not receive your code or the output. Unreleased work stays on your device, and minification keeps working offline once the page has loaded.
Typically 20–40% for readable source, depending on comment density and indentation style. That is real bandwidth savings on cached assets, though far short of what an AST minifier with mangling achieves — the two approaches complement each other.
Keep your readable original as the canonical version and treat the output as disposable. If you also ship stylesheets, run Toolk’s CSS Minifier over them in the same pass so both asset types go out consistently compressed.