About the Iframe Generator tool
Iframes let you embed videos, maps, forms, calendars and other pages inside your own site, but getting the code right matters. A fixed 560 by 315 frame overflows on phones, a missing title fails accessibility checks, and forgetting loading="lazy" slows down your page. This iframe generator builds correct embed code with a live preview.
Enter the address of the page you want to embed. YouTube watch links, youtu.be and Shorts links, and Vimeo links are converted to their embeddable player URLs automatically, since the normal page URL cannot be framed. Choose a responsive embed that fills its container and keeps a 16:9, 4:3, 1:1, 9:16 or 21:9 aspect ratio, or set a fixed width and height. Add a border and rounded corners, allowfullscreen, lazy loading, a referrer policy and permissions such as autoplay, encrypted-media, picture-in-picture or clipboard-write.
The embed code updates as you change options and can be copied or downloaded. The preview shows the real page in a frame, loaded directly from its own server. If it stays blank, the site does not allow being embedded.
How to use Iframe Generator
- Paste the page or video address into “Page or video URL”.
- Write a short, descriptive “Title” for screen readers.
- Choose “Responsive” with an aspect ratio, or turn it off and set width and height.
- Set border, corner radius, allowfullscreen, lazy loading, referrer policy and permissions.
- Check the “Live preview” and copy the “Embed code”.
Features
Responsive embeds
Aspect-ratio wrapper code that scales the iframe to any container width.
YouTube and Vimeo conversion
Watch, short and Shorts links become proper embed URLs, keeping YouTube start times.
Accessibility and performance
Title attribute, loading="lazy" and referrerpolicy are included by default.
Permission control
Pick allow features such as autoplay, fullscreen, camera or geolocation.
Live preview
See the embed exactly as configured before copying the code.
When to use it
- Embed a YouTube video that resizes nicely on mobile.
- Add a Google Form, Calendly booking page or survey to a website.
- Embed a map, dashboard or demo from another site.
- Create iframe code for a CMS or website builder that accepts custom HTML.
- Check whether a site allows embedding before promising it to a client.
Frequently asked questions
How do I make an iframe responsive?
Wrap it in a container with position: relative, height: 0 and padding-bottom set to the aspect ratio (56.25% for 16:9), and make the iframe absolutely fill it. The generator writes this for you.
Why does the preview stay blank?
The target site forbids framing with X-Frame-Options or CSP frame-ancestors. Look for an official embed or share option on that site.
Why was my YouTube link changed?
youtube.com/watch pages cannot be embedded. The /embed/ URL is YouTube's official embeddable player.
Is the frameborder attribute needed?
No. frameborder is obsolete in HTML5. The generator uses CSS border instead.
Does this tool track the pages I embed?
No. The preview is loaded by your browser straight from the embedded site; this site does not proxy or log it.