How to embed a website with an iframe
- Paste the link from your address bar — or paste embed code you already have, and the tool will clean it up.
- Choose how it sits on the page. Responsive is right almost every time; the preview shows the result as you change it.
- Copy the code and paste it wherever your site accepts HTML. There’s a React version for JSX, too.
What each option writes
| Option | In the code | Why |
|---|---|---|
| Responsive | style="width:100%;height:auto;aspect-ratio:16/9" | Fills the column it’s in and keeps its shape on a phone. |
| Fixed | width="640" height="360" | An exact size in pixels, for layouts that need one. |
| Title | title="…" | What screen readers announce. Every iframe should have one. |
| Load when scrolled into view | loading="lazy" | Waits to load the frame until someone scrolls near it, so your page opens faster. |
| Allow full screen | allowfullscreen | Lets video players and maps go full screen. |
| Sandbox | sandbox="allow-scripts …" | The page inside can run, but can’t navigate your page away or start downloads. |
| (always) | referrerpolicy="strict-origin-when-cross-origin" | Tells the embedded site which site it’s on. YouTube refuses to play without it. |
Why a YouTube or Spotify link doesn’t work in an iframe
The page in your address bar isn’t the one meant for embedding. youtube.com and open.spotify.com both forbid being framed; what they allow is a separate player page. The generator translates the link for you:
youtube.com/watch?v=aqz-KE-bpKQ
→ youtube-nocookie.com/embed/aqz-KE-bpKQ
open.spotify.com/playlist/37i9dQZF1DWZeKCadgRdKQ
→ open.spotify.com/embed/playlist/37i9dQZF1DWZeKCadgRdKQ
google.com/maps/place/Eiffel+Tower
→ maps.google.com/maps?q=Eiffel%20Tower&output=embedYouTube links become the privacy-enhanced player on youtube-nocookie.com, which doesn’t set tracking cookies until someone presses play. Twitch is the fussy one: its player only plays on the domain named in its code, so the generator asks for yours.
When a site won’t embed at all
Most sites with a sign-in forbid framing, and nothing in your code can change that — the embed checker shows which header decides it. If what you actually want is to keep several of those sites in view while you work, that’s a job for a browser, not an iframe: Tabula puts each one on a canvas as a live tile, signed in. Or try the multi-site viewer.
Questions
How do I make an iframe responsive?
Give it width:100% and an aspect-ratio in CSS, such as aspect-ratio:16/9, with height left as auto. It then fills whatever column it sits in and keeps its shape at every screen size. The Responsive option writes exactly that.
Why does my YouTube embed show Error 153?
Since late 2025 YouTube’s player refuses to start when the browser doesn’t say which site it is embedded on. That happens when the page or the iframe sets its referrer policy to no-referrer, or a privacy extension strips referrers. The code here always includes referrerpolicy="strict-origin-when-cross-origin", which fixes it.
Can I embed Google Maps without an API key?
Yes, for places, searches and coordinates — that is what this tool writes. Directions, Street View and styled maps need Google’s Maps Embed API, which takes a key.
Where do I paste the code?
Anywhere your site accepts HTML: a Custom HTML block in WordPress, a Code block in Squarespace, an Embed element in Webflow, an Embed HTML element in Wix, or straight into your template. Notion is the exception — it takes the link itself through its /embed command, not code.
Why won’t the tool give me code for some sites?
Because the site forbids being framed, so any code would show an empty box. The tool checks first and says so instead — the embed checker shows which header made the call.
