UTILITIES NEWBIE

Digital tools

HTML structural checker

Find supported structural problems in HTML source while treating scripts and other code as text.

Input

Import a local text file

0 UTF-16 code units

Optional local draft

Saving stores a plaintext draft in this browser on this device. Do not save secrets or use this on a shared device. Nothing is saved or loaded automatically. Reset does not delete a saved draft; use Delete local draft.

No draft has been loaded.

Output

How to use this tool

  1. Paste HTML with explicit closing tags, even where a browser would normally infer an optional end tag.

  2. Select Check HTML structure. Use the reported line and column to locate unsupported or mismatched markup.

HTML formatting and inert preview

Match inside-out closing. Full explanation follows.
Open div, then p. Text explanation

The checked div and paragraph open from outside inward and close from inside outward. Their Hello text contributes a token. The result reports two elements and five tokens under the explicit structural model, not a full HTML conformance or security verdict.

Check explicit HTML tag structure before a detailed page review

Use the checker for a specific structural question

This page checks a bounded HTML fragment for explicit opening and closing tag balance, supported attribute syntax, duplicate attributes and nesting within its model. It is useful when you suspect a crossed closing tag or an unclosed attribute quote. It does not model the full HTML browser parser, optional end tags or every conformance rule. A passing result is therefore a structural observation about this tool's profile, not a declaration that a complete website is valid, accessible or safe. Start by identifying the source fragment and the exact question you want checked.

A small component example is often more useful than an entire page. Preserve the surrounding parent and the closing tags involved in the suspected error, but remove unrelated private content. The checker reads the supplied text; it does not inspect your application repository or obtain the live DOM produced by browser recovery. If your question concerns what a browser actually built from malformed source, you need a browser inspection as a separate step. Comparing that result with this explicit-tag model can reveal why a page appears to work despite a source-level mismatch.

The focused page supplies the structure-check operation. Enter the fragment, run the check and read the generated result or error. The success output includes implementation element and token counts. Those counts are not a measure of page quality, coverage or performance. A component with few elements can still have serious semantic or accessibility issues, while a larger valid structure can be entirely appropriate. Use the message to confirm the particular syntax boundary being investigated rather than converting a successful check into a general readiness score for the whole project.

Follow a parent and child through the check

Checked synthetic input

<div><p>Hello</p></div>

Exact observed output

Structural checks passed: 2 elements, 5 tokens. Explicit opening/closing tags and attribute syntax are balanced.

The worked fixture is a div containing a paragraph with the text Hello. It passes with two elements and five tokens in this model: an opening parent, an opening child, its text and the two closing tags. The exact result sentence appears below with the source. The diagram shows the matching close order, paragraph before div, so it explains why a nested structure closes from the inside outward. This is a concrete specimen, not a claim that every possible HTML construct can be reduced to the same simple token sequence.

Change the final sequence so the div closes while the paragraph remains open. The checked mismatched specimen is rejected rather than silently repaired. That difference is useful when a template edit has crossed component boundaries. Keep the failing source exactly as supplied when writing a report, including the closing-tag order. A browser may recover from some malformed input, but recovery does not make the original explicit tags balanced. Conversely, a rejection under this checker does not by itself explain every visual symptom in a browser. The two tools answer related but different questions.

A list with two explicitly closed list items also passes in the checked example. A version relying on omitted list-item end tags is rejected by this profile, even though HTML has optional-tag rules in particular contexts. This is a deliberate compatibility boundary to understand before using the checker as part of a review. Do not rewrite a whole template merely to make a green status appear without considering the author's intended syntax and consumer. Name the explicit-closing requirement in the test case so another reviewer can reproduce and interpret the result accurately.

Separate the supported model from broader validation

The shared markup limits are 100,000 input UTF-16 code units, 10,000 tokens, 40 nesting levels and 1,000,000 output characters. Optional local text-file import is limited separately to 100,000 bytes. The element and token counters come from this parser's representation, not from a browser's final DOM. A character count is also not necessarily a UTF-8 byte count. Keep these units distinct when reducing a failing specimen. A limit rejection means the bounded tool cannot complete that input under its current contract, not that the same document is impossible for every consumer.

The checker inspects attribute quoting and rejects duplicate attribute names in its supported model. It does not assess whether an attribute supplies a useful accessible name or an appropriate destination. A balanced anchor can point somewhere wrong, and a correctly closed heading can still be chosen at an unsuitable level. Those examples show why structure, semantics and application behavior must remain separate review categories. Use the source result to focus a later check, but do not let it erase the need to inspect meaningful text, keyboard behavior or actual resource loading in the intended environment.

No scripts run and no resources are fetched by the structural processor. This describes the operation, not a reusable sanitization promise for the source you entered. The tool does not certify that a fragment can be inserted into an arbitrary page or trusted by another application. Formatting and inert preview are separate workspace operations, each with their own restrictions. If a preview drops content or attributes, it is intentionally changing the view and must not be treated as an exact production rendering. Retain the original source when moving among these operations.

Turn a result into a useful repair record

For a crossed-tag bug, record the smallest failing fragment and the exact error, then make one intentional correction to its close order. Run the corrected specimen and compare it with the original. The useful record shows both why the first version failed and what was changed; a screenshot of a later success alone loses that explanation. If the fragment is part of a component system, inspect the real assembled source as well. A locally balanced snippet cannot prove that the templates around it do not add or omit a different boundary.

For a documentation review, keep the explicit structural check distinct from rendered examples. Verify that the illustrated source, displayed result and prose all refer to the same specimen. Copy or Download exports the generated result text; it does not export a repaired HTML document or apply changes to your site. If you need a formatted copy of the source after a manual correction, run the separate formatter and review its output as a new stage. Do not infer a repair from a success message that contains no rewritten source.

Finally, state the conclusion narrowly: this exact fragment passed the bounded explicit-tag and attribute checks. Optional-tag compatibility, full HTML conformance, accessibility, security and application correctness remain separate concerns. That wording makes the checker useful without giving it responsibilities it cannot fulfill. Preserve synthetic fixtures and their expected messages for future regressions, especially when a shared component changes. A small repeatable test with clear boundaries is more valuable than an unqualified claim that every page or browser has been validated.

Supporting reference: HTML context; local explicit-check profile is narrower.

Related existing tool: html formatter.

Worked examples

Input and settings

<p>Hello</p>

Expected output

Structural checks passed: 1 elements, 3 tokens. Explicit opening/closing tags and attribute syntax are balanced.

The paragraph has one opening tag, one text token and one closing tag. A browser may accept other documents through error recovery that this explicit-tag subset intentionally rejects.

Related tools

Inert HTML layout preview · Static Pug to HTML converter · HTML text escaper

Find a tool

Type a tool name, such as JSON or percentage.

Quick links

Browse by category

All tools