HTML Embed & Iframe Tester
Check and test HTML embed code safely online
Paste any <iframe> or third-party widget snippet to preview it across desktop, 768px tablet, and 375px mobile viewports inside an isolated browser sandbox—catch mixed content, fixed-width overflow, and missing attributes before pasting into production.
- Hardcoded pixel width overflows mobile screens
Fixed iframe widths (>360px) create horizontal scrolling on phones. Use the one-click Wrap Responsive button to switch to CSS aspect-ratio.
- 1 iframe missing a title attribute
Screen readers rely on the iframe title attribute to announce embedded videos, calendars, or widgets.
- Add loading="lazy" to 1 iframe
Deferring below-the-fold embeds keeps third-party frames from delaying your page's Largest Contentful Paint (LCP).
Why test embed code in a sandbox before pasting into your CMS?
Third-party embed snippets from YouTube, Loom, Calendly, Figma, Stripe, or analytics vendors often ship with hardcoded pixel widths (width="800"), missing accessibility titles, or scripts that conflict with your production styles. Testing an embed inside a logged-in CMS editor can also expose admin DOM context if your editor previews scripts on the same origin.
ViewHTML's Embed Code Tester runs your snippet inside an opaque-origin sandbox iframe (strictly omitting allow-same-origin), checks static security and responsive layout rules in real time, and lets you convert fixed-width iframes into modern CSS aspect-ratio wrappers with one click.
5 common reasons an HTML embed renders blank or broken
Quick diagnostic reference when an iframe works in one place and fails in another.
| Symptom | Root cause | How to fix it |
|---|---|---|
| Grey box: refused to connect | Target host sends X-Frame-Options: DENY or SAMEORIGIN | Use the provider's official /embed/ URL or link out to a new tab |
| Blank box + CSP Console error | Target sets Content-Security-Policy: frame-ancestors excluding your host | Whitelist your domain in the provider's embed settings (Vimeo, Loom, Typeform) |
| Blank on live HTTPS site | Mixed content: iframe or script src uses http:// | Upgrade the embed src URL to https:// |
| Horizontal scrollbar on mobile | Hardcoded pixel width attribute like width="800" | Click Wrap Responsive to switch to width: 100% + CSS aspect-ratio |
| Buttons inside frame fail | Restrictive sandbox attribute missing allow-scripts or allow-forms | Grant only the specific token required without pairing allow-scripts + allow-same-origin |
Test any embed snippet in three steps
- 1
Paste embed HTML
Drop in an <iframe> or third-party widget snippet. Static checks highlight mixed content, fixed widths, and missing attributes automatically.
- 2
Check mobile & wrap
Toggle between Desktop, 768px, and 375px mobile views. Click Wrap Responsive to generate a clean aspect-ratio container.
- 3
Copy or share preview
Copy the fixed embed code into Webflow, WordPress, or Notion—or click Share preview to send a live link for client sign-off.
Frequently asked questions
- How does this embed code tester keep third-party snippets safe?
- Every embed renders inside an isolated <iframe sandbox="allow-forms allow-modals allow-popups allow-scripts"> strictly without allow-same-origin. Third-party scripts cannot read cookies, localStorage, or your logged-in session.
- Why does my iframe say 'refused to connect' or render blank?
- Most blank embeds are blocked by the target server sending X-Frame-Options: DENY/SAMEORIGIN or a Content-Security-Policy frame-ancestors header that excludes your site, or by mixing an http:// src inside an https:// page.
- How do I make a fixed-width iframe responsive on mobile?
- Click the Wrap Responsive button in the toolbar. It replaces hardcoded width/height attributes with width: 100% and modern CSS aspect-ratio (matching your iframe's original ratio), plus title, loading="lazy", and referrerpolicy.
- Can I share the tested embed preview with a client or teammate?
- Yes. Click Share link to create a live preview URL on an isolated *.viewhtml.app subdomain (live 3 days free with zero signup, or permanent when signed in), or open it in the full ViewHTML editor to export PNG/PDF.
More HTML tools on ViewHTML
Live split-pane preview & sharing
Open local .html & .htm files
Paste snippets & preview live
Run HTML, CSS & JS in sandbox
Gmail 102 KB meter, Outlook scan & CSS inliner
Line-by-line code & visual side-by-side diff
Render crisp Headless Chromium PNGs from HTML
Convert GFM Markdown to clean HTML or styled page
Related engineering guides
Deep dive into X-Frame-Options, CSP frame-ancestors, responsive aspect-ratio wrappers, and third-party script isolation.
How opaque iframe sandboxes and *.viewhtml.app subdomains keep untrusted HTML away from auth cookies.