Code & Data

Format HTML without changing how it renders

Paste HTML to indent it. Inline elements stay where they are, whitespace inside pre and textarea is preserved, and script bodies are re-indented rather than reflowed — because all three of those change the page if you get them wrong.

or paste your own — nothing is uploaded.

Indentation

Inline elements stay on their line, because moving them inserts whitespace the browser renders. Script and style bodies are re-indented but never reflowed.

Formatted HTML

Paste HTML above and the result appears here.

  • Runs in your browser
  • No account required
  • Free to use

How it works

01

Moving an inline element changes the page

Putting a `<span>` on its own line inserts a newline the browser renders as a space. That is why `<p>Hello <b>there</b></p>` stays on one line here: a formatter that breaks it open has quietly edited the text, and it is the single most common way a beautifier damages a page.

02

Whitespace is content in some elements

Inside `<pre>` and `<textarea>` every space and newline is meaningful. Those elements are copied out exactly as written; everywhere else whitespace is formatting and is normalised.

03

Script and style contents are not markup

`if (a < b)` inside a script is not the start of a tag. Their bodies are recognised as text, re-indented as a block, and never reflowed — reformatting the JavaScript inside a page is a different job with its own ways to go wrong.

04

It never refuses your markup

HTML is defined to be recoverable, so unclosed tags, omitted `</li>` and stray closing tags are all handled the way a browser handles them rather than rejected. A formatter that only accepts perfect HTML is no use on the pages that need formatting.

What it does

Two, four spaces or tabs

Whatever your project uses.

Handles real-world markup

Void elements, omitted closing tags, attributes containing angle brackets and conditional comments all survive.

Comments kept, or dropped

Kept by default; one checkbox removes them.

Nothing leaves the page

Parsed in your browser and never uploaded — so an unreleased template stays on your machine.

Practical advice

Getting a better result

  • Formatting the same document twice should produce identical output. If it does not, that is a bug worth reporting.
  • If a page looks different after formatting, the cause is almost always whitespace around inline elements — this tool avoids that, but hand-editing afterwards can reintroduce it.
  • Minified HTML formats back into something readable, which is a fast way to understand a page you did not write.

Questions

Things people ask

Will formatting change how my page looks?

It should not. Inline elements are never moved onto their own line, and pre and textarea contents are left byte for byte, which are the two ways formatting normally alters rendering.

Does it fix broken HTML?

It recovers from it the way a browser does — unclosed tags are closed, stray closing tags are dropped — but it does not report the problems. If you want strictness, that is what the XML formatter gives you.

Does it reformat my JavaScript?

No. Script and style bodies are re-indented as a block so they sit correctly in the page, but their contents are otherwise untouched.

Who builds these

Free tools by day. Websites that earn their keep by trade.

KuConvert is built by KUDUY, a web design and development agency. From custom WordPress builds to SEO and e-commerce, everything they do is engineered to bring you more qualified traffic and turn it into revenue.

  • Fixed scope, no surprise invoices

    Most sites ship in four to eight weeks with the scope and the price agreed up front.

  • SEO from day one

    Search is designed into the build — structure, schema and Core Web Vitals — not retrofitted.

  • A team, not a ticket queue

    A project manager, a designer and a developer you can actually reach.

Need your whole site to load this fast?

Images are usually the heaviest thing on a page and the easiest win. KUDUY works on site speed, image delivery and Core Web Vitals for teams who would rather not do it by hand.

This tool runs entirely in your browser. Your files are never uploaded.