HTML Tools

Tools for HTML markup: indent it consistently, catch unclosed or mismatched tags, strip whitespace for production, or preview how a snippet renders in a sandboxed frame.

Popular HTML Tools

All HTML Tools (4)

About HTML

HTML is forgiving: browsers repair many mistakes silently, which means broken markup can look fine in one place and break a layout or a template somewhere else. The HTML Formatter uses the open-source Prettier formatter, which respects whitespace-sensitive inline elements. The HTML Validator does a fast structural check for unclosed and mismatched tags; it is not a replacement for the full W3C validator.

Previews render inside a sandboxed iframe that cannot run scripts, so pasted HTML cannot affect this site.

Which tool to use

The HTML Formatter is for markup you want to read or maintain. The HTML Validator answers a narrower question, whether every tag is closed in the right order, and is the quickest way to find the unclosed element that breaks a layout. HTML Minify suits simple static markup; a page with inline scripts or pre-formatted text is better minified by a build tool that parses HTML. The HTML Viewer previews a snippet without running its scripts, and HTML Escape turns markup into text you can show on a page.

Worked example: Formatting, validating, and previewing an HTML snippet across the 4 tools

Suppose you are debugging a broken product card snippet copied from a CMS:

<div class="card"><h3>Pro Plan & Support</h2><p>Price: <strong>$29/mo</p></div>
  1. Step 1 — Check structure in the HTML Validator: The validator immediately flags two structural bugs on Line 1: <h3> is closed by a mismatched </h2> tag, and <strong> is never closed before </p>.
  2. Step 2 — Indent in the HTML Formatter: Once you fix </h2> to </h3> and add </strong>, the formatter indents each nested element by 2 spaces so the hierarchy is obvious at a glance.
  3. Step 3 — Render in the HTML Viewer: Preview how the card renders in a sandboxed browser frame before shipping, or compress it with Minify HTML for an email template.

Limits and what this tool cannot do

  • Does not execute server-side templates (JSX, Blade, Jinja, EJS, PHP): Template tags like {{ user.name }}, <% if %>, or React className={...} are not standard HTML5 and should be formatted after template rendering (or with a framework-specific formatter like the Angular, Vue, or LWC formatter).
  • No external network requests inside HTML Viewer: Sandboxed previews do not submit forms or run cross-origin scripts against external servers.

Frequently asked questions

Can the HTML Viewer run my JavaScript?

No. The preview is sandboxed without script permission, so scripts in the pasted HTML do not run.

Is the HTML Validator a full W3C check?

No. It finds unclosed and mismatched tags quickly. Use the W3C Markup Validation Service for a complete standards check.

Will minifying change how my page looks?

It removes comments and collapses whitespace between tags. Whitespace inside pre or textarea elements can matter, so check pages that rely on it.

Which HTML tags are 'void elements' that never take a closing tag?

In HTML5, the 14 void elements are area, base, br, col, embed, hr, img, input, link, meta, param, source, track, and wbr. Writing </br> or </img> is invalid HTML.

When should I use HTML Escape instead of HTML Formatter?

Use HTML Escape when you want to display raw code like <script> visibly inside a blog post or tutorial by turning < and > into < and >.

Common use cases

  • Cleaning up HTML copied from a CMS or email template
  • Finding the unclosed div that breaks a layout
  • Previewing a snippet without creating a file
  • Reducing the size of static HTML

Example

<ul class="nav">
  <li><a href="/">Home</a></li>
  <li><a href="/docs">Docs</a></li>
</ul>

Consistently indented markup with every non-void element closed.