Iframe Generator

Generate iframe code with all attributes. No need to remember complex iframe properties - just fill in what you need and get complete, ready-to-use HTML code instantly.

Free Online Tool

Configuration Panel

Customize your iframe with all available attributes

Basic Properties

Enable fullscreen mode

Dimensions & Behavior

Enable payment requests

Loading & Styling

Security & Permissions

Hold Ctrl (Cmd on Mac) to select multiple
e.g., camera; microphone; fullscreen; geolocation

Copy and use in your project

<iframe src="https://www.example.com"></iframe>

See your iframe in action

Ready to Preview

Enter a URL above to see your iframe preview

Complete Iframe Attributes Reference

Complete Iframe Example with All Attributes

<iframe 
  src="https://example.com"
  name="fullAttrIframe"
  title="Example iframe with all attributes"
  allowfullscreen
  width="1200"
  height="800"
  scrolling="auto"
  allowpaymentrequest
  loading="lazy"
  style="border-width: 10px; border-style: solid; border-color: black;"
  sandbox="allow-scripts allow-forms allow-same-origin allow-popups allow-top-navigation-by-user-activation"
  referrerpolicy="strict-origin-when-cross-origin"
  csp="default-src 'self'; script-src 'unsafe-inline' 'unsafe-eval' https://example.com"
  allow="camera; microphone; fullscreen; geolocation; autoplay"
></iframe>

Basic Attributes

src="https://example.com"

The source URL of the page to embed in the iframe.

This is the only required attribute for an iframe to function.

name="fullAttrIframe"

A unique name for the iframe that can be used as a target for links and forms.

Useful for JavaScript targeting and form submissions.

title="Description"

Accessibility attribute that provides a description for screen readers.

Should always be filled with meaningful content for accessibility compliance.

allowfullscreen

Boolean attribute that enables the iframe content to be displayed in fullscreen mode.

Commonly used for video players and interactive content.

Dimension Attributes

width="1200"

Sets the width of the iframe in pixels, percentage, or other CSS units.

Can be: "1200px", "100%", "50vw", "auto", etc.

height="800"

Sets the height of the iframe in pixels, percentage, or other CSS units.

Can be: "800px", "100vh", "50%", "auto", etc.

Behavior Attributes

scrolling="auto"

Controls the scrollbar behavior within the iframe.

Values: "auto" (default), "yes" (always show), "no" (never show)

allowpaymentrequest

Boolean attribute that allows the iframe to request payment information.

Used for payment forms and e-commerce integrations.

loading="lazy"

Controls when the iframe content is loaded.

Values: "lazy" (load when near viewport), "eager" (load immediately)

Security Attributes

sandbox

The sandbox attribute restricts what the iframe content can do for security purposes.

  • allow-scripts - Allows JavaScript execution
  • allow-forms - Allows form submission
  • allow-same-origin - Allows same-origin access
  • allow-popups - Allows popup windows
  • allow-top-navigation-by-user-activation - Allows top-level navigation on user interaction

allow

Specifies which browser features the iframe can use.

Examples: camera, microphone, fullscreen, geolocation, autoplay, picture-in-picture

Why Use Our Complete Iframe Generator?

📋

All Attributes Covered

Every iframe attribute is available with clear explanations and examples

👁️

Instant Preview

See your iframe in action with real-time preview before generating code

🚀

Production Ready

Get clean, optimized iframe HTML code ready for immediate use

🔒

Security Features

Sandbox restrictions, CSP policies, and referrer controls for secure embedding

💾

Configuration Save

Save your iframe settings to localStorage for quick reuse and customization

📱

Responsive Design

Generate mobile-friendly iframe codes with flexible dimensions and units

Common Use Cases for Iframe Generator

Website Embedding

Use our iframe builder to embed external websites, forms, or applications into your own site with full control over dimensions and behavior.

Video and Media

The iframe embed code generator is perfect for embedding YouTube videos, Vimeo content, and other media players with responsive design.

Maps and Location

Create iframe codes for Google Maps, OpenStreetMap, and other location services using our responsive iframe generator.

Social Media Widgets

Embed social media feeds, posts, and widgets with our iframe HTML generator for seamless integration.