HTML Formatter
Paste markup and this browser-local formatter places tags and text on indented lines. Choose two or four spaces, inspect the result, and copy it when it is useful for reading or reviewing. Your HTML stays in this browser session.
Format HTML in three steps
-
1
Paste markup
Add the HTML you want to inspect. Nothing is sent to the server.
-
2
Choose indentation
Use two or four spaces for each nesting level.
-
3
Review and copy
Check the formatted text before you use it elsewhere.
What this formatter does
The formatter is a small structural reader, not a full HTML parser. It puts opening tags, closing tags, comments, declarations and text on separate lines, then applies the selected indentation. Standard void elements such as <img>, <br> and <meta> do not create another nesting level.
Blocks beginning with <pre>, <code>, <textarea>, <script> or <style> are kept together as supplied. The tool does not validate markup, repair unclosed tags, wrap attributes, rewrite self-closing syntax, minify code, or understand a page’s CSS and JavaScript semantics.
Formatting can change whitespace around ordinary text nodes. Treat the output as a readable working copy and compare it before saving a whitespace-sensitive template or publishing it. For validation, use an HTML validator; for byte-preserving transformations, use an editor or formatter designed for your project.
Frequently Asked Questions
No. Formatting and copying happen in your browser. Funnel steps keep the current input only in session storage.
No. It only applies simple indentation and cannot tell whether markup is valid or semantically correct.
No. Complete script and style blocks are kept as supplied.
Related Tools
HEX Color Picker
Pick or enter a HEX colour and get RGB, HSL, approximate CMYK, relative luminance and contrast ratios against white and black.
Color Palette Generator
Generate monochromatic, analogous, complementary, triadic or tetradic color palettes from a base HEX color and export copy-ready CSS variables.
FPS Counter
Measure browser FPS with requestAnimationFrame, smoothing, min/max frame rate, warnings and an optional graph. Runs locally with no upload or API.
ASCII Table Reference
Full ASCII table from 0 to 127 with decimal, hex, octal, binary, standard names and HTML numeric-reference notation, including NUL, LF and DEL.
Phone Validator
Validate phone numbers by country, detect the region and type, and normalize valid numbers to E.164, international, national and RFC 3966 formats.
Random Color Palette Generator
Generate random color palettes from 2 to 15 swatches, choose a vibrant, pastel, muted or dark style, then copy HEX codes or CSS variables.