HTML Formatter

Format HTML markup with readable indentation and controlled whitespace.

Frontend & Design
Preparing your workspace…
Input
Output
Your result will appear here.

How to use

  1. Paste text, open a UTF-8 file, or try the Sample.
  2. Choose the input and settings, then run the tool or enable Auto run.
  3. Review the result, then copy or download it. Changing the input invalidates the previous result.

HTML Formatter

Format HTML markup with readable indentation and controlled whitespace.

Processing runs in your browser. Your input is not sent to DevToolsy.

How it works

Prettier formats HTML as source text. It never renders the submitted markup or executes scripts. Embedded script and style content is left unformatted.

Before and after
Input
<main><h1>Project notes</h1><p>Built with <strong>care</strong> for the web.</p><ul><li>Fast</li><li>Local</li></ul></main>
Output
<main>
  <h1>Project notes</h1>
  <p>Built with <strong>care</strong> for the web.</p>
  <ul>
    <li>Fast</li>
    <li>Local</li>
  </ul>
</main>

Format HTML markup with readable indentation and controlled whitespace.

Options and data fidelity

Choose CSS-aware, strict or ignore whitespace behavior, plus indentation and line width. CSS-aware is the default; ignore mode can change visible spacing in inline content.

Working with the result

Formatting does not audit semantics, accessibility or dangerous markup. Review the output in your own project and use dedicated validators before publishing.

Review the result, then copy or download it. Changing the input invalidates the previous result.

Processing limits

UTF-8 input up to 1 MiB per document, output up to 8 MiB. JSONPath and Schema: 5-second timeout; other tools: 30 seconds.

?

Frequently asked questions

Is submitted HTML rendered or executed?

Prettier formats HTML as source text. It never renders the submitted markup or executes scripts. Embedded script and style content is left unformatted.

How is meaningful whitespace handled?

Choose CSS-aware, strict or ignore whitespace behavior, plus indentation and line width. CSS-aware is the default; ignore mode can change visible spacing in inline content.

Does formatting validate accessibility or security?

No. Formatting does not audit semantics, accessibility or dangerous markup. Review the output in your own project and use dedicated validators before publishing.

Is my input uploaded?

Processing runs in your browser. Your input is not sent to DevToolsy.

Can I open a local file?

UTF-8 input up to 1 MiB · output up to 8 MiB

Find your next tool

Language

Switch language? Your current work will be cleared. Copy or download it first.