Markup Viewer

UtiliStudio Workspace Tool

Format, validate, and inspect HTML and XML documents in a dedicated workspace. Features syntax error detection, tree inspection, and safe preview.

Format, validate, and preview HTML and XML markup directly in your browser
Open in full workspace
Loading Markup Viewer…

Key Capabilities

HTML & XML Beautification

Transform single-line or irregularly indented HTML and XML into cleanly formatted structures with 2-space or 4-space indenting.

Syntax & Tag Validation

Instantly detect unclosed tags, mismatched element pairings, duplicate attributes, and syntax anomalies with line numbers.

DOM Tree Exploration

Navigate hierarchical node relationships, inspect parent-child nesting, and review element attribute sets.

Sandboxed HTML Preview

Safely visualize rendered HTML snippets in an isolated, script-sanitized container directly in your workspace.

How to Use Markup Viewer

1

Paste HTML or XML code

Input your unformatted markup snippet, template, or full document into the code editor.

2

Format or minify markup

Choose Beautify to format tag hierarchy or select Minify to compact the document for production delivery.

3

Review validation & DOM tree

Check syntax feedback for missing closing tags or switch to the tree view to inspect document node structures.

4

Preview or copy output

Switch to the sandboxed preview tab to verify rendered output, or copy clean markup to your clipboard.

Practical Examples

Unformatted HTML Snippet to Cleanly Indented Markup

Compressed or unformatted HTML snippets are structured with consistent tag indentation and attribute alignment.

Input (Raw / Unformatted)
<section class="hero"><div class="container"><h1>UtiliStudio</h1><p>Developer workspace</p><button class="btn">Launch</button></div></section>
Output (Formatted & Indented)
<section class="hero">
  <div class="container">
    <h1>UtiliStudio</h1>
    <p>Developer workspace</p>
    <button class="btn">Launch</button>
  </div>
</section>

Markup Viewer Guide

HTML and XML: related but different

HTML and XML both use angle-bracket tags, attributes, and nested elements, but they have different goals. HTML describes web pages and is deliberately forgiving: browsers follow the HTML Living Standard, which defines exactly how to recover from missing closing tags, misnested elements, and other mistakes. XML is a general data format used for feeds, SOAP services, office documents, SVG graphics, Android layouts, and many configuration files, and it is strict: a document with a single error is rejected.

Because of this difference, the same markup can display perfectly in a browser and still be invalid. A dedicated viewer helps you see both the structure a parser actually builds and the problems it found along the way.

Well-formed XML

An XML document is well-formed when it follows the basic grammar rules. There must be exactly one root element. Every opening tag needs a matching closing tag, or must be self-closing like <item/>. Elements must be properly nested, so <a><b></a></b> is an error. Tag names are case-sensitive, attribute values must always be quoted, and the same attribute cannot appear twice on one element.

Special characters must be escaped. A literal < or & in text must be written as &lt; or &amp;. Larger blocks of text containing many special characters can be wrapped in a CDATA section instead. Well-formedness is different from validity: a valid document is well-formed and also matches a schema, such as an XSD or DTD, that defines which elements and attributes are allowed.

Namespaces and declarations

The optional XML declaration at the top of a file states the version and encoding, for example UTF-8. If the declared encoding does not match the real bytes of the file, accented characters and symbols will appear garbled.

Namespaces let documents combine vocabularies without name clashes. A prefix such as soap: is bound to a URI with an xmlns:soap attribute, and elements with different prefixes are treated as completely different names even if their local names match. Many confusing XPath and parsing problems turn out to be namespace issues, so check the declarations first when a query returns nothing.

Inspecting HTML safely

Formatting minified HTML with consistent indentation makes the document structure readable, and a tree view shows how elements are really nested after parsing. That is often different from how the source looks, because browsers silently move or close elements. A paragraph cannot contain a div, for instance, so the parser closes the paragraph early.

Void elements such as br, img, input, and meta never have closing tags in HTML. Attribute quotes are optional in HTML but required in XML, so markup copied between the two often needs cleanup.

Rendering untrusted HTML is a security risk, because embedded scripts and event handler attributes can run code. A safe preview should sandbox the content or strip active elements before displaying it, and you should always inspect unknown markup as text before opening it in a full browser context.

Troubleshooting common markup errors

When an XML parser reports an error, start at the reported line and look for an unescaped ampersand, a missing closing tag, or a mismatched tag name that differs only in letter case. Errors such as content not allowed in prolog usually mean there is stray text, whitespace, or a byte order mark before the XML declaration.

For HTML, compare the source with the parsed tree. If an element appears in a different place than you wrote it, the parser has repaired invalid nesting, such as a block element inside a paragraph or a form inside another form. Fixing the source to match the parsed tree makes rendering predictable across browsers and easier to style.

Common Use Cases

Cleaning Minified Web Templates

Expand minified component templates, email HTML, and CMS code blocks into easily editable, readable markup.

Validating XML Feeds & Documents

Check RSS feeds, SVG graphics, sitemaps, and SOAP payloads for strict XML well-formedness and closing tag balance.

Inspecting Complex DOM Nesting

Explore deeply nested document trees to detect orphaned container tags and layout-breaking hierarchy errors.

Isolated HTML Snippet Testing

Verify how styled HTML fragments render visually without affecting your surrounding application styles.

Frequently Asked Questions

Which markup formats can I inspect and format?

Markup Viewer supports standard HTML documents, HTML component fragments, XML feeds (RSS, Atom), SVG markup, and general XML configuration payloads.

How does markup validation detect structural errors?

The parser checks the tokenized tag stream to identify unclosed tags, void element misuse, mismatched opening and closing tags, and unquoted or invalid attribute names.

Is the HTML preview secure for untrusted input?

Yes. Preview rendering occurs inside an isolated, sanitized container that strips active script tags, event handlers, and unsafe attributes before display.

Related Developer Tools

Ready to use Markup Viewer?

The tool is at the top of this page, or open it in the full workspace with tabs, favorites, and Ctrl+K search.