Pug to HTML Converter
Paste Pug (Jade) template code and get the equivalent HTML — indentation, selectors, attributes, and void tags are all handled automatically.
Last updated: May 26, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is Pug to HTML Converter?
Pug (formerly Jade) is a template engine for Node.js that uses indentation instead of closing tags. A line like `.card` becomes `<div class="card">`, and the elements indented below it become its children. The result is markup that is much more concise than HTML.
This converter implements a Pug-to-HTML parser entirely in the browser. It parses each line to extract the tag, id, classes, and attributes, then uses indentation to track parent-child relationships. Void elements (`<img>`, `<br>`, `<input>`) are emitted without closing tags. Block literals (tag followed by `.` and indented content) are preserved verbatim.
This is a structural converter — it handles static Pug markup, not the template features like mixins, conditionals, loops, or variable interpolation. For those, use the official Pug CLI.
How to Use Pug to HTML Converter
Paste Pug template code into the input panel.
The HTML equivalent appears instantly on the right.
Click Copy or Download .html to use the result.
Common Use Cases
- Migrating a Pug-based project to a plain HTML setup.
- Compiling Pug snippets to HTML for inclusion in a non-Pug environment.
- Learning HTML by seeing how Pug templates translate to markup.
- Generating an HTML mock from a designer's Pug deliverable.
- Cross-checking the HTML output of a Pug template without running the Pug CLI.
Example Input and Output
A Pug card component expands to a div with class, an h2, and an anchor.
.card
h2#title Hello
a.btn(href='/') Go home<div class="card">
<h2 id="title">Hello</h2>
<a class="btn" href="/">Go home</a>
</div>Privacy
All conversion happens in your browser. No Pug or HTML is sent to a server.
Indentation
Use spaces consistently for indentation. Tabs are interpreted as 4 spaces. Mixed indentation may produce unexpected nesting.

