FreeFile ToolsHTML CSS JS Minifier: Minify Code Locally
Minify HTML, CSS or JavaScript code in your browser. Compare UTF-8 byte sizes, copy or download results; input stays local.
Remove safe-to-discard formatting from HTML, CSS, and JavaScript, then review the byte-size change.
About this tool
Choose HTML, CSS, or JavaScript and minify it directly in this browser. The input is not uploaded or sent to a server.
HTML comments are removed except conditional comments, and whitespace is reduced while retaining text spacing and preserving raw script, style, pre, and textarea contents. CSS comments and nonessential spacing are removed while strings and spacing around plus/minus operators are retained.
JavaScript processing is deliberately conservative: it compresses whitespace outside quoted strings, templates, comments, and recognized regular-expression literals. It does not rename variables or perform parser-based transforms. This is not a full language parser, and edge cases or embedded languages may still need review. Always test the output before production use.
The displayed sizes are UTF-8 byte counts for the input and output strings. Copy and download run locally in your browser.
How to use HTML/CSS/JS Minifier
- Select HTML, CSS, or JavaScript
- Paste code and choose Minify
- Review the output and byte counts before copying or downloading
Supported format
HTML, CSS, JavaScript. File, page and layout limits vary by tool; review the notes on this page before processing.
Good to know
- Minifying is not the same as validating: malformed or unusual syntax may not be detected.
- JavaScript whitespace handling is conservative and avoids aggressive renaming or syntax transforms, but output should still be reviewed and tested.
- The byte comparison is based on UTF-8 text bytes, not transfer size after compression such as gzip or Brotli.
Related tools
Frequently asked questions
Is my code uploaded?
No. Minification, copying, size calculations, and downloads are handled in your browser.
Does this guarantee JavaScript behavior is unchanged?
No. This lightweight tool is not a complete JavaScript parser or optimizer. It uses conservative whitespace handling, but you should review and test the output.
What happens to comments?
HTML comments are removed except conditional comments. CSS comments are removed. JavaScript comments are retained to avoid removing directives or changing parser-dependent behavior.
How is the size comparison calculated?
It compares the UTF-8 byte lengths of the pasted source and generated output. It does not estimate gzip or Brotli transfer size.
What does the tool do with malformed code?
It reports clear errors for empty input and certain unterminated comments, tags, strings, or regular expressions. Other syntax is not fully validated.
All tools
- Compress PDF — Optimize PDF structure in your browser and download only when the file is measurably smaller.
- Merge PDF — Combine multiple PDFs into one document, in your chosen order.
- PDF Compare — Compare selectable text in two PDFs side by side. Files stay in your browser.
- PDF Form Filler — Fill supported interactive PDF form fields in your browser and download the completed PDF.
- PDF Signer — Add a visible drawn, typed, or image signature to a PDF in your browser.
- PDF Metadata Editor — Read and edit standard PDF document properties locally in your browser.
- PDF Repair — Try a local PDF recovery pass and validate the saved copy in your browser.
- Split PDF — Extract selected pages or page ranges into a new PDF.
- PDF Page Reordering — Reorder pages in a PDF with thumbnails and accessible controls. Processing stays in your browser.
- Delete PDF Pages — Remove selected pages from a PDF in your browser and download the remaining pages.
- Rotate PDF — Rotate every page of a PDF by 90, 180 or 270 degrees in your browser.
- PDF Unlocker — Remove open-password protection from an authorized PDF using its correct password, locally in your browser.
- PDF Password Protector — Add verified AES-256 open-password protection to a PDF locally in your browser.
- PDF Flattener — Flatten supported PDF forms and annotations; PDFs with optional-content layers are rasterized using their default visible state locally.
- PDF Redactor — Permanently cover selected PDF content by rebuilding every page as a flattened image, locally in your browser.
- PowerPoint to PDF — Convert supported PPTX slides to a raster PDF locally in your browser; text is not selectable.
- PDF to PowerPoint — Convert PDF pages locally to images, editable text boxes, and supported editable vector shapes.
- PDF Page Numbers — Add centered page numbers to each PDF page in your browser.
- PDF Watermark — Add a light, diagonal text watermark to every PDF page in your browser.
- PDF to Word — Convert selectable text in a PDF into an editable Word document in your browser.
- Word to PDF — Convert a DOCX document to a page-image PDF in your browser.
- PDF to JPG — Export each PDF page as a high-quality JPG image.
- JPG to PDF — Create a PDF from your JPG images, one image per page.
- PDF to Text — Extract selectable text from PDF documents into a text file.
- PDF OCR — Recognize printed English or Urdu text in scanned PDF pages.
- PDF to Excel — Extract selectable PDF text and estimate columns for simple tables in a downloadable spreadsheet.
- Compress Image — Make JPG, PNG and WebP images smaller with adjustable JPG quality.
- Image Cropper — Select a rectangular area of an image and crop it in your browser.
- QR Code Generator — Create a QR code from text or a URL and download it as a PNG in your browser.
- Barcode Generator — Generate Code 128, Code 39, EAN-13, EAN-8, UPC-A, UPC-E and ITF barcodes locally; download vector SVG or PNG.
- QR Code Scanner — Scan standard QR codes from images or an optional camera locally in your browser.
- Audio Converter — Convert browser-decodable audio files to WAV (16-bit PCM) or MP3 (192 kbps) locally in your browser.
- Audio Cutter — Trim browser-decodable audio to a precise time range and download WAV locally in your browser.
- Resize Image — Resize an image to exact dimensions or preserve its proportions.
- Image Upscaler — Enlarge JPG, PNG and WebP images 2× or 4× with high-quality browser interpolation.
- Image Color Picker — Sample pixels from an image and read accurate HEX and RGB values locally in your browser.
- Favicon Generator — Create downloadable PNG favicon sizes, an ICO file and a web manifest locally in your browser.
- Image to Base64 / Base64 to Image — Convert PNG, JPG and WebP images to Base64 or turn valid Base64 image data into a downloadable file locally.
- Image Metadata Viewer — View image details locally and read supported JPEG EXIF fields such as camera make/model, orientation and dates. PNG/WebP EXIF parsing is not supported.
- SVG to PNG/JPG Converter — Safely rasterize supported SVG files to PNG or JPG in your browser. Files stay on your device.
- Image to Text OCR — Recognize English or Urdu text in PNG, JPEG and WebP images locally in your browser.
- JSON Formatter & Validator — Validate JSON syntax, format it with indentation, or compact it locally in your browser.
- YAML to JSON Converter — Convert supported YAML mappings and sequences to JSON locally in your browser.
- SQL Formatter — Format SQL with a selected dialect locally in your browser. This tool does not validate or execute queries.
- URL Encoder & Decoder — Encode or decode URL components locally, including spaces, reserved characters and Unicode.
- HTML/CSS/JS Minifier — Minify HTML, CSS and JavaScript locally with conservative syntax-aware whitespace handling.
- JWT Decoder — Decode JWT header and payload locally; does not verify signatures or establish trust.
- UUID Generator — Generate one or more secure UUID v4 values locally in your browser.
- WCAG Color Contrast Checker — Check text color contrast against WCAG AA and AAA standards using local HEX color calculations.
- SHA-256 Hash / Checksum Generator — Generate browser-local SHA-256 checksums for files or exact UTF-8 text.
- CSV ↔ JSON Converter — Convert UTF-8 CSV and JSON locally, with quoted-field support and spreadsheet formula protection.
- Regex Tester — Test JavaScript regular expressions locally with flags, match positions and capture groups.
- Text Diff Checker — Compare two text versions line by line and review additions and removals locally in your browser.
- Subtitle Converter — Convert SRT subtitles to WebVTT or WebVTT to SRT locally, preserving cue timing and multiline text.
- XML Formatter & Validator — Validate well-formed XML and format it locally in your browser. DTDs and entity declarations are refused.
- HTML Entity Encoder & Decoder — Encode reserved HTML characters or decode named and numeric entities locally in your browser.
- Markdown Previewer — Write Markdown and preview safe formatted output locally in your browser.
- Password Generator — Generate strong random passwords locally with secure browser cryptography.
- Unix Timestamp Converter — Convert Unix timestamps and dates locally with explicit seconds or milliseconds and timezone labels.
- Text Case Converter — Transform text between common writing and programming cases locally in your browser.
- Image Background Remover — Make a selected image color transparent locally in your browser and download a PNG.
- JPG to PNG — Convert a JPG image into lossless PNG format.
- PNG to JPG — Convert a PNG to JPG with a clean white background.
- WebP to JPG — Turn WebP images into widely supported JPG files.
Enable JavaScript to process files in your browser.