How to Use the HTML to Pug Online
- 1Paste a small fragment with explicit opening and closing tags. Start with one component or section so the result is easy to inspect.
- 2Check how the converter represents IDs and classes. Double-quoted values can become hash and dot shorthand on the tag line.
- 3Compare the resulting indentation with the original parent and child elements. Restore attributes and inline markup that the draft did not carry over.
- 4Try the reviewed draft in your project’s Pug renderer and compare the generated HTML with the source fragment.
Input & Output Examples
The section’s ID and both classes become shorthand. The heading and paragraph appear on indented lines.
<section id="news" class="panel wide"><h2>News</h2><p>Latest updates</p></section>section#news.panel.wide
h2 News
p Latest updatesThe list has a class in shorthand form and its two child items share the same indentation.
<ul class="links"><li>Docs</li><li>Support</li></ul>ul.links
li Docs
li SupportPractical Developer Workflows
- Draft a Pug version of a small static component while keeping the original HTML available for comparison.
- Show how a plain container, heading, and paragraph are expressed in an indentation-based template language.
- Convert the outline of a fixture before adding Pug-specific variables, attributes, or other expressions in the project.
Zero Server Uploads & Complete Privacy
Runs 100% in your browser; no data is uploaded to any server.
Let us know directly so our engineering team can fix it.