Why convert HTML to Jade in the first place?
Pug is significantly more concise than HTML — typically 30–50% fewer lines because closing tags disappear and class/id become single-character shorthand. Teams migrating to a Pug-based stack (Express, Eleventy, Vite plugins) usually start by converting their existing HTML, then maintain only the Pug source going forward.
Does the output use Jade or Pug syntax?
They are the same language — Jade was renamed to Pug in 2016 after a trademark dispute. The output works identically with the jade or pug npm package, with Eleventy, with Vite Pug plugins, and with any tooling that accepts Pug indent-based templates.
How are class and id attributes converted?
class="card primary" becomes .card.primary, id="hero" becomes #hero, and combining both produces #hero.card.primary. Other attributes remain in parenthesised lists: (href="/x", target="_blank"). When the tag is div, the converter omits div entirely — .card by itself is a div.
Is the output exactly equivalent to my HTML?
Compiled back, the Pug produces semantically identical HTML. Some cosmetic differences may appear: attribute order can differ, void elements like <br> are emitted as br, and HTML entities may be normalised. Run the output through pug --pretty to see the round-trip result.
Will inline style and script blocks be preserved?
Yes. Pug uses dot-block syntax (style. and script.) to embed raw content. The converter outputs the children as a text block — open the result and you will see your CSS or JS verbatim under a script. or style. parent.
Why does the converter use the browser DOM parser?
The browser already ships a battle-tested HTML parser (DOMParser). Using it means malformed but browser-tolerated HTML — unclosed <p>, <li> without </li>, attributes with no quotes — is handled the same way the browser handles it, instead of erroring out on a strict regex.
Is my HTML uploaded to your servers?
No. Conversion uses the browser DOMParser and runs entirely in JavaScript on your device. HTML containing internal copy, customer data, or unreleased layouts never leaves your machine. DevTools Network tab confirms zero requests on click.
Can I use the Pug output with Eleventy or a Vite plugin?
Yes. Eleventy supports Pug as a first-class template language (set the .pug extension), and Vite/Webpack both have community Pug plugins. The output of this converter is plain Pug — no special directives — so it drops into any Pug-aware build pipeline without modification.