Text Tools

HTML Renderer

Render HTML snippets locally without leaving the browser or running scripts.

Start here Paste the HTML fragment into the left panel; the preview updates as you type.

Rendered preview

The preview is sandboxed and scripts are disabled for safety.

Understand the format

How HTML Renderer works

A sandboxed preview shows how markup will be laid out, with scripts disabled, so untrusted snippets can be reviewed without executing anything.

How the sandbox works

The markup is placed in an iframe using the srcdoc attribute together with a fully restrictive sandbox attribute. With no allow tokens, the browser applies every restriction available: scripts do not run, forms cannot submit, the frame gets a unique opaque origin, and it cannot navigate the page that contains it. What you see is the rendered structure of the markup, nothing more.

That trade-off is deliberate. Anything driven by JavaScript will not appear, but any snippet, including one copied from a suspicious email or an untrusted CMS field, can be inspected safely.

What a preview can and cannot tell you

The preview reliably answers questions about structure and inline styling: whether tags are balanced, whether a wrapper is missing, how a table or list renders, and whether inline CSS produces the intended layout. It is a fast way to review content fragments before they are pasted into a template.

It cannot answer questions about the surrounding application. Site stylesheets, custom fonts, external images, framework hydration, and script-driven behaviour are all absent. Confirm the final appearance in a real environment before shipping.

Step by step

How to use HTML Renderer

  1. Paste the HTML fragment into the left panel; the preview updates as you type.
  2. Check the structure: heading order, list and table nesting, and whether every element is closed.
  3. Add inline styles to test presentation, since external stylesheets are not loaded.
  4. Verify accessibility basics such as alt text on images and a label for every form control.

Markup is rendered locally inside a sandboxed iframe. Nothing is uploaded, and the frame cannot read the surrounding page or submit data.

Worked examples

HTML Renderer examples explained

Reviewing a CMS content fragment

Input

<h2>Release notes</h2><ul><li>Fixed export</li><li>New filters</li></ul>

Result

A heading followed by a two-item bulleted list

Renders the semantic structure that assistive technology will announce, before the site stylesheet changes its appearance.

A script that does not execute

Input

<p>Hello</p><script>alert(1)</script>

Result

Only the paragraph is rendered

The sandbox blocks script execution, which is what makes it safe to preview markup from an untrusted source.

Reference

What renders in the sandboxed preview

What renders in the sandboxed preview
FeatureWorks hereWhy
Semantic markup and textYesParsed and laid out by the browser as normal.
Inline style attributesYesApplied directly to the elements.
Inline style blocksYesCSS inside the document is honoured.
JavaScriptNoBlocked by the sandbox attribute.
Form submissionNoBlocked, so a snippet cannot post data anywhere.
External images and fontsDependsRemote requests may be blocked by the frame origin or by the network.

Practical Guide

How teams use HTML Renderer

Common use cases

  • Test content fragments coming from CMS fields, email templates, or documentation systems.
  • Review copied markup for broken nesting or a missing wrapper element.
  • Validate a small presentational change before editing an application template.

Checks before trusting the result

  • Scripts are disabled, so this is a markup review rather than a behavioural test.
  • External assets may need a real environment to render exactly as production does.
  • Treat pasted HTML from untrusted sources as data to inspect, never as code to run elsewhere.

Troubleshooting

Common mistakes and how to fix them

Expecting a JavaScript-driven component to work in the preview.
It never will. Test interactive behaviour in a development build of the real application.
Assuming the preview reflects production styling.
No site stylesheet is loaded. Inline the styles you want to test, or check in the real page.
Pasting user-generated HTML into an application after previewing it here.
A safe preview is not a sanitiser. Sanitise on the server with a maintained library before storing or rendering it.

FAQ

HTML Renderer questions, answered

Is it safe to preview HTML from an unknown source?

Yes, within this page. The frame runs with a fully restrictive sandbox, so scripts do not execute and forms cannot submit. That is not a licence to publish the same markup on a live site.

Why does my JavaScript not run?

By design. The sandbox attribute is applied with no allow-scripts token, which is what makes previewing untrusted markup safe.

Can I preview a complete HTML document?

Yes. A full document including head and body renders correctly, as do inline style blocks within it.

Why do my images not appear?

Remote assets may be blocked by the sandboxed frame origin or unavailable from your network. Use a data URI, or check in a real environment.

Does the markup get uploaded anywhere?

No. It is passed to the iframe srcdoc attribute in your browser and never sent to a server.

Go deeper

Specifications and guides