Tested tool guide
Tested browser tools
Checked August 16, 2026
What HTML to Pug Converter does, with a checked example
HTML to Pug Converter rewrites an HTML fragment or document as Pug source. Element nesting becomes indentation, closing tags disappear, and HTML attributes are expressed in Pug's attribute notation. Text nodes stay with their corresponding elements, producing template source that can be edited or pasted into a Pug file. The most consequential surprise is that indentation is executable structure in Pug, not cosmetic formatting. Preserve the leading spaces when copying the result, and inspect whitespace-sensitive content before using it.
Worked example
A concrete input and expected output from the current implementation.
Input
<section>
<h1>Notes</h1>
<p>Two items</p>
</section>
->
Expected output
section
h1 Notes
p Two items
The section becomes the outer Pug tag. Its h1 and p children are indented one level, and their short text nodes follow their tag names on the same lines.