Skip to content

HTML / CSS / JS beautifier & minifier — offline

Readable or tiny — formatted on your device, with the real Terser compiler for JS.

100% private — files never leave your device
Input
Output

Beautify or minify HTML, CSS and JavaScript offline

Source code is usually the last thing that should be pasted into an unknown website. Proprietary logic, internal API endpoints, embedded configuration, and the occasional hard-coded key all travel with it. Yet formatting is the most mundane task imaginable — pure text transformation that needs no server at all.

Everything runs in your browser: beautifying with js-beautify, JavaScript minification with the real Terser compiler. Nothing is transmitted; the site has no backend, and a Content-Security-Policy blocks third-party requests. Load the page, go offline, and it keeps working.

Beautifying: making unreadable code readable

Beautifying restores indentation, line breaks, and spacing to code that has lost them. The usual reasons are minified library source you need to debug, a one-line CSS blob copied from a page, HTML scraped without whitespace, or a colleague's snippet that arrived with its formatting destroyed by a chat client.

Worth being clear about the limits when beautifying minified JavaScript: indentation comes back, but names do not. Minifiers rename local variables to single letters, and that transformation is irreversible — no beautifier can recover the original identifiers or the comments. You get structure back, which is usually enough to follow the logic, not the original source.

Minifying, and whether the output still behaves the same

Minifying strips whitespace, comments, and redundancy to reduce transfer size. JavaScript minification here uses Terser — the same compiler that runs in real build pipelines, not an approximation — which performs only safe transformations, so the output is functionally equivalent to the input, just smaller.

That said, minifying by hand is best treated as a one-off convenience for a standalone script, an inline snippet, or a quick size comparison. For anything you ship regularly, put minification in your build pipeline instead, where it runs reproducibly, generates source maps so production stack traces remain debuggable, and cannot be forgotten before a release.

Related and equally local: SQL formatter, JSON formatter, and diff checker — format both sides first and the real changes stop hiding behind whitespace.

How to beautify or minify HTML, CSS and JS offline

  1. 1

    Pick the language.

  2. 2

    Paste your code.

  3. 3

    Beautify for readability or minify for size, then copy.

HTML/CSS/JS Formatter — frequently asked questions

Is my source code uploaded?

No — beautifying uses js-beautify and JS minification uses Terser, both running in your browser. Proprietary code stays on your machine.

What can it format?

HTML, CSS, and JavaScript — beautify (readable indentation) or minify (smallest size). JS minification uses the real Terser compiler; HTML/CSS minification strips comments and collapses whitespace.

Does minified JS behave identically?

Terser performs safe transformations only — the output is functionally equivalent, just smaller.