Jade to HTML / HTML to Jade

Convert Jade templates to HTML and HTML back to Jade.

0 chars
0 words
0 lines
0 chars
0 words
0 lines

Jade to HTML Converter (and HTML to Jade)

Jade is the original name of the template language now called Pug. Thousands of older Express, Harp and Grunt projects still contain .jade views, and when you need to move such a page to a different stack, a static host or a CMS, the fastest path is to turn the template into regular HTML. This tool does exactly that, and it also works the other way round when you want to bring an HTML snippet into a Jade codebase.

How the conversion works

The converter reads your template line by line. Indentation defines nesting, the first word is the tag name, and #id / .class shorthand creates attributes. Attribute lists in parentheses, inline text, piped text (| ...), dot blocks (script.), block expansion (li: a Home) and comments are all supported. The legacy !!! 5 doctype shortcut from early Jade versions is recognised too and becomes <!DOCTYPE html>.

What you get

  • Readable HTML with two- or four-space indentation, or a compact single-line version when pretty printing is off.
  • Void elements such as img, input and meta without closing tags.
  • A report of skipped logic – conditionals, loops, mixins and includes cannot be evaluated without your data, so they are listed in a closing comment instead of being silently lost.

Migrating a legacy project

A good workflow is to convert each view, compare it with the rendered page in the browser, and then reintroduce dynamic parts in your new templating system. If you are staying with the language, switch to the HTML to Jade mode to generate fresh templates — the output is also valid modern Pug. For a quick visual check, paste the HTML result into the HTML Viewer, or tidy it with the HTML Beautifier.

Frequently Asked Questions

They are the same language. Jade was renamed to Pug in 2016 because of a trademark issue. Pug 2 dropped a few old features (like the !!! doctype shortcut and attribute interpolation), but plain markup templates are compatible, and this converter accepts both.

Yes. Paste the file or its content here and copy or download the HTML. Everything runs in your browser; no Node.js, npm or build step is needed.

No. Mixins, include, extends, block and JavaScript lines need a template runtime with access to your files and data. The converter skips them and lists the skipped lines in a comment at the end of the output.

If you upgrade the build to Pug 2 or 3, yes. Converting the HTML back with the HTML to Jade mode produces syntax that is also valid Pug, so the output works for both extensions.