Home/ Free tools/ Embed code generator

Free Embed Code Generator

Paste a URL, pick your width and height, toggle a few options, and copy clean <iframe> embed HTML — for your Knocket page, a video, a map, or anything the browser can show. See a live preview, then paste the code into your site. No login, nothing stored.

Live preview
Enter a URL to see the preview…

Blank preview? The site blocks embedding — the code is still correct.

Embed HTML — copy this
 
Embed your Knocket contact page — visitors chat with you without leaving your site. Get your page →
◈ EMBED YOUR OWN CONTACT PAGE

The most useful thing to embed is a page that lets people reach you. A free Knocket contact page is built to be embedded — drop it on your site and visitors get live chat, WhatsApp, email, and booking without you writing a form or a backend. Get your free page →

Why an embed code generator matters

Embedding one page inside another is one of the oldest web primitives, but hand-writing the <iframe> tag — with the right width, a title for screen readers, lazy loading, and a safe sandbox — is fiddly and easy to get wrong. A generator gets it right every time and shows you the result before you ship.

How to embed a page

  1. Paste the URL you want to embed (your Knocket page, a video, a map, a doc).
  2. Set the size — fixed width/height, or responsive (100% width).
  3. Add a title for accessibility and toggle options (fullscreen, lazy-load, border, sandbox).
  4. Copy the HTML and paste it into your site's HTML or CMS embed block.
◈ WHERE TO PASTE

In a Custom HTML block in WordPress, a Code Embed in Wix, an Embed block in Squarespace, or directly into your site's HTML. In a React/Astro layout, drop the <iframe> in via a raw HTML element. The tag is self-contained — no scripts, no stylesheets to load.

What people embed

When an iframe isn't the right tool

An iframe is perfect for showing another page inside yours. It's not the right tool when you need to:

For a contact experience that lives natively on your site (no iframe, your domain, your styling), a Knocket widget is one script tag instead.

Frequently asked questions

Is this embed code generator free?

Yes — completely free, no login, no limits. The HTML is built in your browser, nothing is uploaded or stored. Generate as many embed codes as you want.

Why is my preview blank?

The site you're embedding is sending an X-Frame-Options or Content-Security-Policy header that refuses to be framed. Google, Instagram, Facebook, and most logged-in pages do this. The generated code is still correct — the site simply won't allow itself to be embedded anywhere, by anyone. Knocket pages and most video players (YouTube, Vimeo) allow embedding.

What does the sandbox option do?

The sandbox attribute restricts what the embedded page can do, so an untrusted embed can't pop up windows, run forms, or access your page. Restricted (recommended) lets the embed run scripts and forms but blocks the dangerous stuff; Strict allows scripts only. Turn it off for a trusted page that needs full capabilities.

What's the title field for?

The title attribute on the iframe tells screen readers what's inside — essential for accessibility. Without it, visitors using assistive tech hear "frame" with no context. Always set it to describe the embedded content (e.g. "Knocket contact page").

Responsive or fixed size?

Use responsive (100% width) when the embed should fill its container — most modern sites. Use a fixed width and height when you need exact dimensions, like a video player or a square map. Responsive embeds usually pair with an aspect-ratio wrapper on your page.

Does lazy-load help?

Yes. loading="lazy" tells the browser to load the iframe only when the user scrolls near it, which speeds up your initial page load — especially helpful if you have several embeds on one page.

Do you store the URLs I enter?

No. Everything runs in your browser — the URL, title, and options never leave your device. There's no server, no database, no account.

Can I embed my Knocket page?

Yes — and it's a great use. Your Knocket contact page is built to be embedded: visitors get live chat, WhatsApp, email, and booking right on your site, no form or backend to write. Paste your knocket.trtc.io/your-handle URL and copy the code.

More free tools

Embed a page that talks back.

The best thing to embed is one that lets people reach you. A Knocket page brings live chat, WhatsApp, email, and booking to any site.

Create your free page