🪟 iFrame Generator
Generate HTML iframe embed code with attributes: src, width, height, title, sandbox, allow, loading. Live preview, copy and clear — all in your browser, no upload, instant results.
About the iFrame Generator
This iFrame generator runs entirely in your browser. Fill in the source URL, dimensions, and any optional attributes (title, loading, allow, sandbox, class, id, style), and the tool produces a ready-to-paste <iframe> tag with a live preview. Nothing is uploaded — all generation happens locally with JavaScript on your device.
Common attributes
- src — The URL of the page to embed. Required for the iframe to display anything.
- width & height — The dimensions of the iframe. Accepts pixels (e.g.
560) or percentages (e.g.100%). - title — An accessible label describing the iframe content. Important for screen reader users.
- loading —
lazydefers loading the iframe until the user scrolls near it.eagerloads immediately. - allow — A list of feature policies the embedded page may use, e.g.
fullscreen,geolocation,camera. - sandbox — Restricts the embedded page's capabilities for security. Combine tokens like
allow-scriptsorallow-same-originas needed. - frameborder — Legacy attribute for the border. Modern sites should use
style="border:0;"instead. - class, id, style — Standard HTML attributes for styling and identification.
How to use the generator
- Enter the Source URL — this is the only required field.
- Set the width and height. Use percentages for responsive embeds.
- Add a title for accessibility (recommended).
- Pick loading="lazy" if the iframe is below the fold to improve page load performance.
- Use allow to grant specific permissions (e.g.
fullscreenfor video players). - Click Copy and paste the generated HTML into your page.
Frequently asked questions
Does this tool upload my data? No. Everything happens locally in your browser. Your inputs never leave your device.
Why won't my iframe load? Many sites (Google, Facebook, X/Twitter, etc.) send an X-Frame-Options or Content-Security-Policy header that prevents them from being embedded. This is a server-side choice — the iframe tag is correct, but the destination refuses to render.
What's the difference between allow and sandbox? allow grants additional permissions to the embedded page (like fullscreen or camera). sandbox restricts the embedded page's capabilities (like running scripts or submitting forms). They are complementary.
Should I always use sandbox? For untrusted content, yes — apply the most restrictive sandbox that still lets the content work. For trusted first-party content, sandbox is often unnecessary.