Word to HTML Converter
Turn Word documents (.docx) or text pasted from Word into clean HTML or Markdown for any website, CMS or email.
Minify HTML to make your pages smaller and faster, or beautify messy HTML so it is easy to read and edit. See exactly how many bytes you save, then copy or download the result.
Updates as you type. Text in <pre> and <textarea> and attribute values are never changed. If your layout relies on gaps between inline-block items, choose Keep one space.
Your minified or beautified HTML and the size saved will appear here. Paste some HTML or try the example.
The HTML Minifier & Beautifier turns your markup into whichever form you need. Paste HTML or drop an .html file, then press Minify to get a smaller page for your website, or Beautify to turn a squashed, one-line page into neatly indented code you can read and edit. The result updates as you type and shows the size before and after, so you can see exactly how many bytes you saved.
Minifying removes comments and the whitespace that browsers ignore, such as the line breaks and indentation between block elements like div, p and li, while keeping a single space where text and inline elements need it. Text inside pre and textarea, and every attribute value, is left exactly as written. It also drops default attributes such as type="text/javascript", and it can minify inline style and script blocks with the same engines as our CSS and JS minifiers. Conditional comments and comments that start with <!--! are kept unless you turn that off. If your layout relies on the gaps between inline-block items, choose Keep one space.
Beautifying uses the open-source js-beautify library to put each block element on its own line, indented with 2 spaces, 4 spaces or tabs, while short inline content such as links and bold text stays on one readable line. Inline CSS and JavaScript can be formatted too. The tool also warns you about tags that are never closed, closing tags with no match and unfinished comments, with the line number. Everything runs in your browser, so your HTML never leaves your device. It does not use AI.
No. Minifying and beautifying happen in your browser on your own device. The formatting libraries are downloaded from this site the first time you need them, and your HTML is never sent to a server, so it is safe to use with private or unreleased pages.
It is designed not to. Smart mode only removes whitespace that browsers do not show, such as spaces between block elements like div, p and li, and it keeps one space between inline elements. The one thing it cannot know is your CSS: if you have made li, div or similar elements display inline-block, the space between them is visible, so choose Keep one space instead. Content in pre and textarea is never changed.
Yes, if Minify inline CSS and JavaScript is ticked. Style blocks are minified with the same engine as our CSS Minifier, script blocks with Terser, and JSON-LD is compacted. Scripts of other types, such as templates, are left alone. If a block has a syntax error, it is kept exactly as written and you see a warning with the line number.
All normal comments are removed when you minify. Conditional comments such as <!--[if IE]> and comments that start with <!--! (often used for licences) are kept by default, because removing them can change behaviour or break a licence. Untick the option to remove those too, or untick Remove comments to keep every comment.
It depends on how the page is written. Hand-written HTML with indentation and comments usually shrinks by 10 to 25 percent, and more if it has large inline styles and scripts. Pages that are mostly attributes and inline SVG shrink less. Your web server's gzip or Brotli compression then makes the download smaller still.
No. It reformats your HTML without repairing it, but it does warn you about common mistakes: tags that are never closed, closing tags with no matching opening tag, unfinished comments and attribute values with a missing quote. Each warning shows the line number so you can fix it in your source. Tags that HTML lets you leave open, such as li and p, are not reported.
Turn Word documents (.docx) or text pasted from Word into clean HTML or Markdown for any website, CMS or email.
Format, validate and minify JSON, find errors by line, fix common mistakes, browse a tree view or convert to CSV.
Encode and decode Base64 text and files, turn images into data URIs, and encode, decode or parse URLs.