JSON Converters Code Gen Formatters All tools Browse all tools built byAbhay Darji

HTML Minifier

Strip whitespace and comments from HTML to reduce its size.

100% client side No upload No size limit Works offline
Input
Output
Ready
Drop a file to load it

About this tool

Remove every byte that does not change meaning — indentation, line breaks and, optionally, comments.

When you would use it

  • Reducing payload size
  • Embedding a document in a single line
  • Preparing markup for production

Worked example

HTML
<div class="card">
  <h2>Ada Lovelace</h2>
  <p>Score: <strong>91.5</strong></p>
</div>
Minified
<div class="card"><h2>Ada Lovelace</h2><p>Score: <strong>91.5</strong></p></div>

Things worth knowing

  • Whitespace inside <pre> and <textarea> is significant and is preserved.
  • Conditional comments are kept, since removing them changes behaviour in old browsers.
Questions

Frequently asked

Is minifying safe?
Yes — only insignificant whitespace is removed. Whitespace-sensitive elements are left alone.
Is my data uploaded anywhere?
No. Every tool on JSONWorks runs entirely in your browser using JavaScript. Your input is never sent to a server, never logged and never stored. The simplest proof is to disconnect from the internet — the tools keep working. The site does load Google Fonts and a Google Analytics page-view tag, so you will see those two requests in your network tab, but neither receives anything you type or paste.
Does it work offline?
Yes. JSONWorks is installable as a progressive web app and caches itself on first visit, so every tool keeps working without a connection.
Related

Tools that pair well with this