AnyNPC
Options
Input
Output
Minified code will appear here

Code Minifier — Minify HTML, CSS & JavaScript Online

Free online code minifier for HTML, CSS, and JavaScript. Compress and optimize your code by removing whitespace, comments, and unnecessary characters. Reduce file size, improve page load speed, and boost Core Web Vitals. Features include language auto-detection, copy to clipboard, one-click download, real-time size stats with compression ratio. 100% client-side processing — your code never leaves your browser.

Features

  • Minify HTML, CSS, and JavaScript in one unified tool — no need to switch between different sites
  • Automatic language detection — paste any code and the tool identifies HTML, CSS, or JS automatically
  • Remove comments (HTML <!-- -->, JS // and /* */, CSS /* */) to strip unnecessary bytes
  • Collapse whitespace — eliminate extra spaces, tabs, and line breaks for compact output
  • Real-time size comparison with original vs minified size and compression ratio percentage
  • One-click copy to clipboard and download as .html, .min.js, or .min.css file
  • Detailed statistics including bytes saved, compression ratio, and character count
  • Support for large files with browser-native processing — no file upload limits
  • 100% client-side processing — your source code never leaves your browser
  • Dark mode compatible with clean, minimal interface optimized for developer workflow

How to Use

  1. 1Select your language tab — HTML, JavaScript, or CSS — or paste code and let auto-detect choose for you
  2. 2Paste or type your code into the input editor. You can also load an example using the sample buttons above the editor
  3. 3Configure minification options: toggle Remove Comments and Collapse Whitespace on or off
  4. 4Click the Minify button — your minified code appears instantly in the output panel with size statistics
  5. 5Copy the minified output to your clipboard with one click, or download it as a file using the Download button

Frequently Asked Questions

Related Tools

HTML Entity Encoder — Escape/Unescape Special Characters Online

HTML entity encoder and decoder. Encode special characters (< > & " ') to HTML entities or decode entities back to readable text. Prevents XSS attacks and broken markup when displaying user-generated content or code snippets. Supports named entities, decimal (&#38;), and hex (&#x26;) numeric references. Features include encode-all-non-ASCII option, drag-and-drop file upload, one-click copy, and download results as text files. All processing runs locally in your browser — your data never leaves your device.

URL Encoder/Decoder — Percent Encoding Online Tool

URL encoder and decoder. Encode text to URL-safe percent encoding or decode percent-encoded URLs back to readable text. Supports UTF-8 characters including emojis, Chinese, and other Unicode scripts. Features include spaces-as-plus encoding for form data, uppercase hex option, drag-and-drop file upload, one-click copy, and download results as text files. All processing runs locally in your browser — your data never leaves your device.

JSON Formatter — Beautify, Validate & Minify JSON Online

JSON formatter, validator, and beautifier. Format, minify, pretty-print, and syntax-highlight JSON data instantly. Features include key sorting, custom indentation (2/4 spaces or tab), line numbers, tree view, error highlighting with line/column position, drag-and-drop file upload, one-click copy/download. All processing runs locally in your browser — no server uploads.

SQL Formatter — MySQL, PostgreSQL & SQL Server Beautifier

Free online SQL formatter, beautifier, and minifier. Format and beautify SQL queries for MySQL, PostgreSQL, SQL Server, Oracle, SQLite, and 15+ dialects instantly. Features include keyword case conversion (UPPER/lower/Capitalize), custom indentation (2/4 spaces or tab), syntax highlighting with color-coded keywords, instant minification for production, real-time formatting as you type, drag-and-drop file upload, error detection with line positioning, and one-click copy/download. All processing runs locally in your browser — no server uploads.

XML Formatter — Beautify, Validate & Minify XML Online

Free online XML formatter, beautifier, and minifier. Format and beautify XML documents with custom indentation options (2/4 spaces or tab). Features include syntax highlighting with color-coded tags and attributes, instant minification for production use, real-time formatting as you type, drag-and-drop file upload (.xml), error detection with line positioning, one-click copy/download, and support for XML comments, CDATA sections, and processing instructions. All processing runs locally in your browser — no server uploads.