Format inert HTML source text

HTML Formatter

Format HTML source text with two spaces, four spaces, or tabs. Pasted markup stays inert: it is not rendered, executed, or sent to a server.

Enter source text to begin.

Source text, never a preview

HTML is tokenized and written only into text controls. Pasted scripts are not executed, markup is never inserted with innerHTML, and referenced images or styles are not fetched.

Preserved source details

Element order, attributes, comments, raw script/style text, and quoted values remain source text. Formatting changes layout whitespace, not attribute or URL values.

Practical formatter scope

The formatter supports ordinary HTML structure but is not a browser validator or repair engine. It does not claim to normalize every malformed fragment.

Practical input limit

Input is limited to 6 MB of text. Small files, common 100 KB and 1 MB inputs, and representative 5 MB workloads are supported locally; larger work should use a streaming or command-line workflow.

Related developer tools

Browse all Developer Tools.