Web & Developer Utilities100% Client-Side

Pug to HTML Converter

Paste a few simple Pug lines to see the HTML tags behind their shorthand. The tool can expand an explicit tag name, an ID, dot-separated classes, and text written on the same line. It handles each line independently, so use it to inspect standalone elements and short sibling lists. For indentation-based nesting, attributes in parentheses, and template expressions, use your project’s Pug renderer to produce the complete HTML.

Input
57 chars•3 lines
Output

Reverse tool

HTML to Pug

Convert simple HTML snippets to Pug syntax with indentation, ID shorthand, and class shorthand. Prepare a draft template and review its attributes locally.

Open HTML to Pug

How to Use the Pug to HTML Online

  1. 1Paste a short snippet containing explicit tag names. Start with standalone elements whose text and classes appear on the same line.
  2. 2Check that a hash-prefixed ID became an id attribute. Confirm that each dot-separated class appears in the class attribute.
  3. 3Read the result as source text and review any lines that still look like Pug. Features outside the supported shorthand need a template renderer.
  4. 4Copy the fragment into your draft and compare the resulting structure with what you intended, especially where the source had nested lines.

Input & Output Examples

The explicit tag expands to a paragraph with an ID, two classes, and the text on the same line.

Input Sample
p#status.notice.visible All systems ready
Expected Output
<p id="status" class="notice visible">All systems ready</p>

Each tag line becomes a separate HTML element. The pipe-prefixed line becomes plain text.

Input Sample
h2 Release notes
p.summary Summary
| Internal draft
Expected Output
<h2>Release notes</h2>
<p class="summary">Summary</p>
Internal draft

Practical Developer Workflows

  • Look up how simple ID and class shorthand expands when reviewing a Pug snippet in documentation.
  • Produce the HTML for a pair of standalone elements before adding them to a static test fixture.
  • Inspect a template’s short text lines and class names while preparing a fragment for an HTML-based editor.

Zero Server Uploads & Complete Privacy

Runs 100% in your browser; no data is uploaded to any server.

Notice a bug, calculation error, or outdated info?

Let us know directly so our engineering team can fix it.

Frequently Asked Questions

This converter trims each line and expands it independently. A tag on an indented line becomes a separate element in the result. Use the Pug compiler to reproduce a parent and child hierarchy that is expressed through indentation.

Explore Other Tools

12 suggested tools

View all tools