ToolSink

HTML Formatter

Indent, prettify or minify HTML, XML and JSX. 100% client-side — your markup never leaves the browser.

What is the HTML Formatter?

The HTML Formatter indents and prettifies HTML, XML and JSX markup, including the JavaScript and CSS inside inline `<script>` and `<style>` blocks. Paste minified build output or one-line CMS markup and get back readable source.

Only whitespace changes — the parsed DOM is identical. Formatting runs in your browser.

How to use the HTML Formatter

  1. 1Paste the raw HTML, XML or JSX into the input box.
  2. 2Pick an indent size (2 or 4 spaces).
  3. 3Click "Format" and copy the output — or minify with a single click.

Key features

  • Formats HTML, XML and JSX
  • Beautifies embedded script and style blocks
  • Minify mode for production output
  • Attribute order preserved by default

Frequently asked questions

Will it change my code semantically?

No — only whitespace changes. The DOM is identical after parsing.

Does it support Vue or Svelte syntax?

Vue single-file components format reasonably; Svelte-specific syntax is not fully supported.

Tap any tool to jump straight in — no signup, works on mobile.

View all →