Skip to content
Created by Iternal Technologies, the AI Strategy ExpertsBy Iternal (opens in a new tab)

Format & Minify

JavaScript Minify

JavaScript

Paste JavaScript to strip comments and extra whitespace.

Minified JavaScript

About JavaScript Minify

JavaScript Minify removes line comments and block comments, then collapses whitespace outside strings, templates and regular expressions. A space stays only where two words or numbers would otherwise merge, or where joining two marks would change an operator such as + + into ++.

The inside of a quote, a template literal or a regular expression is not changed, and locals are not renamed. A newline between two words becomes a single space, so write a semicolon when a line break is the only thing ending a statement.

This is a whitespace formatter, not a full JavaScript parser. It does not understand TypeScript types, JSX or every regular-expression edge. A less-than sign that might start a JSX tag is left alone.

Frequently asked questions

What does JavaScript minify remove?

It removes // and /* */ comments and collapses whitespace outside strings, templates and regular expressions. It does not rename locals or rewrite the text inside quotes.

When does minify keep a space?

A space stays between two identifiers or numbers, and between marks that would join into a different token, such as + next to + or / next to /. Other spaces are removed.

Does a line break between return and a value survive?

No. Minify turns that line break into a space, so return and the next word become one statement. Add a semicolon after return if you need the line break to end the statement.

Is the text I paste uploaded anywhere?

No. Minifying runs in your browser and the JavaScript you paste is never uploaded, logged or stored. Google Analytics records page views and feature use, never content.

Iternal · AI Blueprint Builder

Plan the AI initiative, not just the output

The AI Blueprint Builder scores each use case across value, feasibility, cost, governance, risk, adoption and readiness before you commit budget. Free to start, about 60 minutes.

Open the AI Blueprint Builder (opens in a new tab)