Convert a small static Pug example into inspectable HTML
Confirm that the template is inside the static subset
This focused page converts a supported static Pug or JADE-style specimen into HTML source. It accepts literal tag names, consistent space indentation, plain text and supported literal quoted attributes. It does not execute a template program, load includes, evaluate expressions or substitute application variables. Before using it, decide whether your example is a static fragment or depends on a full Pug runtime. A short static specimen can be useful for learning how indentation expresses parent-child relationships, but a dynamic application template may be outside this converter's contract even when it is valid Pug elsewhere.
The distinction matters when you copy an example from a larger project. A template can rely on variables, mixins, filters or inheritance that are not visible in a tiny excerpt. Removing those features until the excerpt converts does not establish that the resulting HTML is equivalent to the application output. Keep the original template and describe any deliberate simplification. This tool is intended for a bounded conversion you can inspect, not for silently replacing a production compiler or migrating an entire view system without the necessary context and tests.
Choose this page when you need an explicit HTML representation of a simple teaching example or static fragment. The page supplies the Pug-to-HTML operation. Input starts as source text, and the generated result is HTML text that you can compare, copy or download. It does not automatically place that HTML into your application. A separate preview, if used elsewhere in the workspace, is deliberately inert and incomplete. Do not treat a preview's omissions as the output of this conversion or as proof that the original template has been sanitized.
Trace a section with two children
Checked synthetic input
section
h2 Plan
p A simple noteExact observed output
<section><h2>Plan</h2><p>A simple note</p></section>The worked input names a section at the left margin, then indents an h2 and a p by two spaces. The children contain Plan and A simple note as literal text. The checked result is a section containing the corresponding heading and paragraph in that order. It is emitted as compact HTML rather than a promise of a particular pretty-print style. Compare the exact result below: the indentation in the input establishes structure, while explicit opening and closing tags carry that structure in the generated representation. The words themselves remain the intended static content.
A second example uses a list with two child items. The output retains One before Two and closes each item explicitly. This is a useful test of sibling order and indentation because both children share the same parent and indentation level. A line indented inconsistently is not repaired by guessing which ancestor the author intended. Use one consistent step and begin the top-level tag at the left margin. Tabs are rejected in the checked profile. A visually similar mix of tabs and spaces can therefore fail, and copying the actual text is more reliable than counting apparent gaps in a screenshot.
Literal quoted attributes can be part of a supported static example, but the page does not accept arbitrary code inside them. Verify the exact attribute spellings and values when using your own fixture. Do not assume that every syntax shown in the complete Pug language reference is available here. In particular, interpolation, buffered expressions, includes, mixins, filters, shorthand and template control flow are outside the stated subset. The diagram emphasizes literal structure and order, not a runtime execution pipeline. That distinction keeps a successful conversion from implying capabilities the page does not have.
Respect source, whitespace and feature boundaries
The shared markup input cap is 100,000 UTF-16 code units. Static Pug parsing is bounded at 10,000 nonempty lines or tokens and 40 nesting levels, with a 1,000,000-character output cap. Optional local text-file import separately allows up to 100,000 bytes. These are different measurements. A line-heavy specimen and a deeply nested specimen can reach different bounds despite similar file sizes. The tool does not truncate an input into a supposedly equivalent output. Preserve the source and reduce a test case deliberately if you encounter one of these restrictions.
The static converter rejects unsupported raw-text, preformatted and foreign-element constructs rather than claiming to preserve every specialized content model. It also rejects literal HTML inside the supported Pug text forms. Those restrictions differ from the full Pug language. If a real template uses one of those features, use the project's intended compiler and appropriate safe tests instead of trying to bypass the rejection. The purpose of a reduced specimen is to investigate a particular structure, not to manufacture a misleading pass by deleting the very feature that defines the original behavior.
Whitespace is part of the review. HTML generated from indentation can have different presentation from a source editor's layout, and text boundaries can matter when inline elements sit next to words. This page does not guarantee identical rendered spacing for every original template or every stylesheet. Inspect meaningful adjacent text in the intended destination after reviewing source output. A successful static conversion is not full HTML validation, accessibility certification or a reusable sanitizer. It also cannot verify the business meaning of the content, the correctness of a link or the authorization to publish the result.
Use a controlled conversion and handoff
For a tutorial, start with one parent and two siblings, show the exact Pug and HTML together, and explain the relationship in ordinary language. Add a nested level only when it teaches something new. Check that indentation, tag names, sibling order and literal text agree across the code blocks and diagram. The accessible text explanation lets readers follow the lesson without depending on the image. Avoid introducing an application variable into an example that is described as static; that would make the demonstration depend on behavior this tool explicitly does not provide.
For a migration investigation, isolate a genuinely static fragment and retain the original complete template in your project. Compare the output with the intended runtime's output where such a comparison is available in an authorized local test. Differences in whitespace or supported features should be recorded rather than silently normalized away. Copy and Download hand off generated text, not a project patch or a compiler replacement. Review the receiving file's context before using the result, especially if the fragment is embedded inside a larger template or component with its own escaping rules.
When processing fails, record the precise source and error, then change one feature at a time. An inconsistent indentation step, a tab or an expression can explain a failure without making the whole template universally invalid. Keep that distinction in the conclusion. The useful outcome is a verified static conversion within a named subset, accompanied by enough source and expected output to reproduce it. Full-template behavior, production compatibility, security and deployment remain separate responsibilities rather than promises inferred from a successful local text conversion.
Supporting reference: Full Pug language context; only static subset supported here.
Related existing tool: html formatter.