iFrame Generator
Build iframe embed code with a responsive aspect-ratio wrapper rather than a fixed pixel height, lazy loading, a referrer policy and a sandbox. The sandbox is on by default, because an empty sandbox attribute is the most restrictive setting rather than a missing one. The tool warns about the combinations that matter — notably allow-scripts together with allow-same-origin, which lets the embedded page remove its own sandbox. Everything is generated in your browser; nothing is uploaded and no result is recorded anywhere.
How it works
Fill in a URL and the embed code appears below. The responsive option wraps the frame in a box with a fixed aspect ratio instead of a fixed pixel height, which is what stops a video letterboxing or overflowing on a phone.
Sandbox is on by default. An empty sandbox attribute is the most restrictive setting, not a missing one — the embedded page gets no scripts, no forms, no popups and no access to your page. Enable only what the content genuinely needs.
Everything is generated in your browser, and the URL you type is not fetched or sent anywhere.
Enter a URL above and the embed code appears here.
Many sites refuse to be framed at all, using an X-Frame-Optionsheader or a frame-ancestors content security policy. That is the site’s decision and no attribute here overrides it — if a frame comes up blank, that is usually why.
Frequently asked questions
Why is allow-scripts with allow-same-origin dangerous?
Together they let the embedded page reach into its own frame element and remove the sandbox attribute, at which point the sandbox stops being a boundary at all. It is a documented escape, so the combination is only safe for content you fully control.
What does a responsive iframe do differently?
Instead of a fixed pixel height it uses a wrapper with a set aspect ratio, so the frame scales with its container. That is what stops a video letterboxing on a narrow screen or overflowing the page.
Why is a title attribute required?
Without one a screen reader announces the frame as an unlabelled region with no indication of what it contains. It is a one-line addition and it is required for WCAG conformance.
The embedded page comes up blank. Why?
Many sites refuse to be framed, using an X-Frame-Options header or a frame-ancestors content security policy. That is the site own decision and no attribute on your side overrides it.
Should I use lazy loading?
Usually yes. A frame below the fold does not need to load until the visitor scrolls to it, and deferring it can noticeably improve how quickly the rest of the page becomes usable.
Related tools
YouTube Thumbnail Grabber
Get every thumbnail size for a YouTube video from any link shape, plus ready-made embed code.
HTML Formatter & Beautifier
This HTML formatter re-indents markup using a real parser, so nesting and inline elements are handled correctly.
Meta Tag Generator
Build the meta, Open Graph and Twitter tags for a page, with a length check on the title and description.