HTML to Jade / Pug Converter
Paste HTML and get the equivalent Pug (formerly Jade) template with id/class shorthand, nested indentation, and proper attribute syntax.
Last updated: May 26, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is HTML to Jade / Pug Converter?
Pug (formerly Jade) is a high-performance HTML template engine with a clean, whitespace-significant syntax. Instead of opening and closing tags, Pug uses indentation to define nesting. Classes and IDs are written as shorthand (`.class` and `#id`), and attributes go in parentheses after the tag name.
This tool converts standard HTML to Pug syntax using a DOM-based parser. It handles the full HTML structure: doctypes, nested elements, attribute lists, void tags, inline text content, and verbatim `<script>` and `<style>` blocks. The output is a valid Pug template ready to use in Node.js projects.
How to Use HTML to Jade / Pug Converter
Paste HTML into the input panel.
Toggle options: quote style, comment preservation, doctype format.
The Pug output appears instantly on the right.
Copy and use it in your Pug/Node.js project.
Common Use Cases
- Migrating an existing HTML project to a Pug-based template engine.
- Converting HTML snippets from a designer into Pug templates.
- Learning Pug syntax by converting familiar HTML.
- Generating Pug starting points from HTML prototypes.
Example Input and Output
A simple HTML structure converts to Pug with id/class shorthand.
<div id="app" class="container">
<h1>Hello</h1>
<p class="intro">World</p>
</div>#app.container
h1 Hello
p.intro WorldPrivacy
All conversion happens in your browser. No HTML is sent to a server.
div shorthand
In Pug, if a tag has an id or class but is a div, the "div" tag name can be omitted. This tool automatically omits "div" when an id or class is present, producing #id.class instead of div#id.class.
Frequently Asked Questions
What is the difference between Jade and Pug?
Jade was renamed to Pug in 2016 due to a trademark conflict. They are the same template engine — Pug is the current name.
Does this support all HTML attributes?
Yes. Any HTML attribute is included in the Pug attribute list. Boolean attributes (like disabled or checked) are rendered without a value.
How are script and style contents handled?
Script and style block contents are rendered verbatim inside a Pug dot (.) block, which passes the content through unchanged.
Does this send my HTML anywhere?
No. All conversion happens locally in your browser.
Related Tools
Pug to HTML Converter
Convert Pug (formerly Jade) template syntax to HTML markup. Handles selectors, attributes, nested indentation, void tags, and doctype declarations.
HTML Beautifier
Format and beautify minified or messy HTML code.
HTML to Markdown Converter
Convert HTML into clean, readable Markdown — preserving headings, links, images, lists, and tables.
HTML Cleaner
Clean messy HTML by removing inline styles, scripts, comments, empty tags, Word markup, class and data attributes.
HTML Minifier
Compress HTML by removing whitespace, comments, and redundant attributes — with size reduction stats.
Jade / Pug to HTML Converter
Convert Jade (Pug) templates to HTML in your browser. Handles tags, id/class shorthands, attribute lists, pipe text, doctype, and comments.

