Tool

Embed Code Tester

Paste iframe HTML, preview the destination, inspect important attributes, and catch common embed-code problems before publishing.

Paste embed codeParsed locally in your browser

This preview uses a restricted sandbox and no referrer. It tests the first iframe URL; scripts, srcdoc and other pasted HTML are not executed. Its permissions may differ from your original embed.

Run the test to preview a valid iframe URL.
Why this page exists

Test the code, not just the URL

A URL can be embeddable while the iframe code around it is still poor. Width and height may be unsuitable, the frame may be missing an accessible title, lazy loading may be absent, or a sandbox policy may grant more capabilities than the embed needs.

The main Iframe Tester answers whether a destination is likely to permit framing. This embed code tester answers a different question: is the iframe markup itself sensible?

Attributes worth checking

  • src: the page or embed endpoint the browser loads.
  • title: an accessible description of the embedded content.
  • width and height: the initial viewport dimensions. Responsive layouts often use 100% width with a controlled height or aspect ratio.
  • loading: lazy can defer offscreen frames, while eager loads immediately.
  • referrerpolicy: controls how much referrer information the browser sends to the framed site.
  • allow: delegates selected browser features such as fullscreen, autoplay or clipboard access.
  • sandbox: applies restrictions to the framed document and then selectively restores capabilities through tokens.

Why a valid iframe can still show an error

Correct HTML cannot override the destination server. If the site returns X-Frame-Options: DENY, SAMEORIGIN, or a restrictive CSP frame-ancestors policy, the browser can reject the frame even when your embed code is perfectly valid. Use the X-Frame-Options checker when the markup looks right but the content does not load.

Technical references

FAQ

Common questions

What does an embed code tester check?

This tool parses the first iframe in your pasted HTML, shows key attributes such as src, title, loading, allow and sandbox, warns about common problems and previews a valid HTTP or HTTPS source inside a restricted test frame.

Does this tool execute all pasted HTML?

No. It does not inject arbitrary pasted markup into the page. It extracts the iframe element and uses the iframe source for a restricted preview, which reduces the risk of executing unrelated pasted scripts.

Why should an iframe have a title?

A meaningful title helps assistive technology identify what the embedded frame contains. Generic or missing titles make navigation harder for screen-reader users.

Should every iframe use loading=lazy?

Lazy loading is useful for frames that start below the fold because it can defer network work. An iframe that is immediately visible or essential to the first screen may be better loaded eagerly.

Keep testing

Related tools and guides