📄

HTML Minify/Format

Minify your HTML code for production or format it for better readability with this powerful online tool.

Formatting Options:

Original Size: 0 bytes

Result Size: 0 bytes

Size Reduction: 0%

Examples:
Basic HTML
Form Example
Table Example
Complex HTML
Html Minify Format - Code Tools | OOPEN AII

Welcome to My Website

This is a basic HTML document example.

Name Age City
John Doe 30 New York
Jane Smith 25 London
Html Minify Format - Code Tools | OOPEN AII

Welcome to Our Website

This is a complex HTML structure example.

Feature 1

Description of feature 1.

Feature 2

Description of feature 2.

Features

  • ✨ Beautiful HTML formatting with proper indentation
  • ⚡ Efficient HTML minification to reduce file size
  • 📊 Shows size reduction percentage
  • 📋 Easy copy to clipboard functionality
  • 💻 Works entirely in your browser
  • 🔧 Customizable formatting options
  • 📚 Multiple code examples for reference

Related Tools

CSS Minify/Format JS Minify/Format HTML Preview
Copied to clipboard!
\n\n
\n

Hello World

\n

This is an example paragraph.

\n
\n\n'; updateSizeInfo(); }); // Format button click formatBtn.addEventListener('click', function() { htmlOutput.value = formatHTML(htmlInput.value); updateSizeInfo(); }); // Minify button click minifyBtn.addEventListener('click', function() { htmlOutput.value = minifyHTML(htmlInput.value); updateSizeInfo(); }); // Copy to clipboard copyBtn.addEventListener('click', function() { htmlOutput.select(); htmlOutput.setSelectionRange(0, 99999); try { document.execCommand('copy'); // Show notification copyNotification.classList.add('active'); setTimeout(() => { copyNotification.classList.remove('active'); }, 2000); } catch (err) { console.error('Failed to copy:', err); } }); // Load beautify example beautifyExampleBtn.addEventListener('click', function() { const minifiedCode = 'Html Minify Format - Code Tools | OOPEN AII

Hello

This is minified HTML.

'; htmlInput.value = minifiedCode; htmlOutput.value = formatHTML(minifiedCode); updateSizeInfo(); }); // Load minify example minifyExampleBtn.addEventListener('click', function() { const formattedCode = '\n\n\n Html Minify Format - Code Tools | OOPEN AII\n \n\n
\n

Hello

\n

This is formatted HTML.

\n
\n\n'; htmlInput.value = formattedCode; htmlOutput.value = minifyHTML(formattedCode); updateSizeInfo(); }); // Example tabs exampleTabs.forEach(tab => { tab.addEventListener('click', function() { // Remove active class from all tabs and contents exampleTabs.forEach(t => t.classList.remove('active')); exampleContents.forEach(c => c.classList.remove('active')); // Add active class to clicked tab and corresponding content tab.classList.add('active'); document.getElementById(`${tab.dataset.example}-example`).classList.add('active'); }); }); // Initial size update updateSizeInfo(); });