Skip to content
Shrake DevTools
  • JSON FormatterData & Format
  • JSON ValidatorData & Format
  • JSON MinifierData & Format
  • JSON ↔ YAML ConverterData & Format
  • XML FormatterData & Format
  • Base64 Encoder / DecoderData & Format
  • URL Encoder / DecoderData & Format
  • JWT InspectorData & Format
↑ ↓ to navigate↵ to openEsc to close

HTML Formatter

Runs locally in your browser. Your input is not uploaded.Free, no sign-up

Input

Output

Format and minify HTML and check its basic structure.

How to use the HTML Formatter

  1. Paste HTML, or click Sample.
  2. Choose the indentation and line width. Inline CSS and JavaScript are formatted too.
  3. If the markup is broken, for example a closing tag that doesn't match, you'll see the problem and its line.
  4. Use Minify to shrink it for production. Copy or download the result.

Formatting without changing the page

In HTML, spaces between inline elements are visible: <b>a</b> <i>b</i> shows a gap that <b>a</b><i>b</i> doesn't. Keep rendering exact (the default) only adds line breaks where they can't show, which sometimes moves a tag's closing > to the next line. Tidier formats freely, which can add or remove a space next to inline elements.

What Minify does

  • Collapses runs of whitespace to a single space, and removes comments (IE conditional comments stay).
  • Removes whitespace only where it can never render, such as between <meta> tags or table rows.
  • Leaves <pre>, <textarea>, <script> and <style> content exactly as written.

Frequently asked questions

Which formatter is this?

Prettier, the formatter most web projects use, running in your browser. The output matches what npx prettier gives with the same options.

Is my HTML uploaded or run?

No. It's parsed and printed in your browser; scripts in it are never executed.