Code Beautifier & Minifier
Auto-detect HTML, CSS or JS — format or compress in one panel.
Free code beautifier and minifier. Auto-detects HTML, CSS or JS to format/prettify or minify in one panel. Beautify or compress code privately in your browser.
About Code Beautifier & Minifier
Code Beautifier & Minifier is a free, in-browser tool that formats (pretty-prints) or compresses HTML, CSS, JavaScript, and JSON, automatically detecting the language from whatever you paste. Beautifying uses js-beautify (and JSON.stringify for JSON) with a 2-space, 4-space, or tab indent; minifying uses Terser for genuine JS compression and literal-safe whitespace/comment stripping for HTML and CSS. Everything runs locally — no signup, no upload, and your code never leaves your device.
How to use Code Beautifier & Minifier
- Paste your HTML, CSS, JavaScript, or JSON into the input box (up to 10 MB).
- Leave the language picker on Auto to let it detect the format, or override it to HTML, CSS, JS, or JSON if needed.
- Pick your indent: 2 spaces, 4 spaces, or Tab.
- Click Beautify to pretty-print, or Minify to compress.
- Read the result in the output panel and check the input/output size and percentage change.
- Copy the output or download it as a file.
Frequently asked questions
- Is it free and do I need an account?
- Yes, it is completely free with no signup. There is no account, paywall, or usage limit.
- Are my files or code uploaded to a server?
- No. All formatting and minifying run entirely in your browser using JavaScript, so your code never leaves your device and nothing is uploaded.
- Which languages does it support?
- HTML, CSS, JavaScript, and JSON. It auto-detects the language from your paste, and you can override the choice with the language picker.
- How does the JavaScript minifier work?
- JS minify uses Terser, which mangles variable names and drops dead code for genuinely smaller output. If a snippet can't be fully parsed, it falls back to a literal-safe whitespace pass so strings and regexes stay intact.
- Will minifying break strings, comments, or whitespace-sensitive content?
- No. HTML and CSS minify only collapse whitespace and strip comments while protecting quoted strings, and HTML preserves the contents of <pre>, <textarea>, <script>, and <style> blocks. JS minification preserves string, template, and regex literals.
- Is there a size limit?
- Yes. Input is capped at 10 MB because everything processes synchronously in the tab; larger pastes are rejected with a warning to keep the browser responsive.
People also search for
Code Beautifier & Minifier is also known as beautify and format code, code beautify minify, html css js formatter, prettify javascript, minify css online, compress html code, pretty print code.