Jade to HTML Converter
CV-63Paste Jade or Pug markup and get HTML. It covers the common syntax: tags, ids, classes, attributes, text, comments and script or style blocks. Anything else is reported with its line number.
Runs in your browser. Nothing is uploaded.
Jade / Pug
HTML
How to use it
- Paste your Jade or Pug into the input box.
- Leave Indent the HTML on for readable output, or turn it off for one line.
- Pick the indent size.
- Fix any reported line, then copy the HTML or download it as a .html file.
What syntax is supported
Tags, #id and .class shortcuts (a bare .card is a div), attribute lists with quoted text, numbers and boolean attributes, text after a tag, | piped lines, a trailing dot for a raw text block such as script or style, tag: child expansion, a trailing slash for self-closing tags, doctype, // comments and //- comments that are not output. Repeated classes are merged. Plain text and piped text are copied as written, so inline HTML in them stays, while attribute values are escaped.
What is not supported
This is a small compiler, not the Pug engine. It has no values to work with, so variables, JavaScript in attributes, string joins with +, #{ } and #[ ] interpolation, code lines starting with - or =, if, else, each, case, mixins, include, extends and block are not supported. Each one stops the conversion with a message that names the line and the reason. Indentation must be consistent: tabs or spaces, not both.
Check the output
The result is not compared against the official Pug compiler, so test anything that matters. A doctype other than html is written as typed after <!DOCTYPE. Boolean attributes are written without a value. In indented mode, text inside an element is placed on its own line, which the browser may display with slightly different spacing than the compact version.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
Line 1: conditionals and loops need data, which this tool does not have. | A line starts with if, else, each, case or a similar keyword. | Replace the line with the plain markup you want, then convert. |
Line 1: interpolation (#{ }, !{ } and #[ ]) is not supported. | The line holds a #{ } value or a #[ ] tag that needs data to fill in. | Write the final text in place of the interpolation. |
Line 3: indentation is not a whole multiple of the first indent | A line is indented by an amount that does not fit the first indent you used. | Use the same number of spaces, or tabs, at each level. |
No Pug found to convert. | Nothing produced output; the input is empty or only silent comments. | Add a tag or text. |
Questions people ask
How do I convert Jade to HTML?
Paste the Jade or Pug into the input box and the HTML appears. Choose the indent size or turn off indenting for a single line. If a line uses an unsupported feature, you get an error with its line number.
Does it support variables, loops and mixins?
No. Those need data and the full template engine. The tool reports the line and the feature, so you know what to replace by hand before converting.
Is Jade the same as Pug?
Pug is the new name of Jade, and the common syntax is the same. This tool reads that shared subset, so Jade and Pug files with only tags, attributes and text convert the same way.
Why are my ampersands not escaped in text?
Pug copies plain text as written, so inline HTML works inside text lines. The tool does the same. Attribute values are escaped, so an ampersand in a link address becomes &.
How do I write a script or style block?
End the tag with a dot and indent the lines below it, for example script. followed by indented code. The lines are copied as raw text into the element.
About this tool
A small compiler for the common subset of Jade and Pug, not the full engine. Supported: tags, #id and .class shortcuts (a bare .card is a div), attribute lists with quoted text, numbers and bare boolean attributes (written without a value), text after a tag, | piped text, a trailing . for a raw text block such as script or style, tag: child block expansion, a trailing / for a self-closing tag, doctype, // comments (written as HTML comments) and //- comments (dropped). Plain text and piped text are copied as written, like Pug does, so inline HTML in them stays; attribute values are escaped. Repeated classes are merged. A doctype other than html is written as typed after <!DOCTYPE. Not supported, and reported as an error with the line number: variables and any JavaScript (including unquoted attribute values and + joins), #{ } and #[ ] interpolation, - and = lines, if, each, case and other control flow, mixins, include, extends and block, and &attributes. Indentation must use either tabs or spaces consistently. The output is not compared against the real Pug compiler, so check anything critical.