How To Embed Google Form In Html

6 min read

Learning how to embed a Google Form in HTML is one of the simplest ways to collect information directly from your website visitors without asking them to leave your page. Still, whether you are running a small business, managing a school event, or building a personal portfolio, embedding a form keeps the user experience smooth and increases the chances that people will actually complete your survey, registration, or contact request. Instead of sharing a long, standalone link, you can place the form right inside your web page using a small snippet of code. In this guide, you will learn exactly how to generate the embed code, insert it into your HTML file, adjust its size, and make it responsive for mobile users.

What Does It Mean to Embed a Google Form in HTML?

To embed a Google Form in HTML means to display the form directly within your own web page rather than sending users to a separate Google website. This is done using an iframe, which is an HTML element that allows you to load another document inside your current page. When a visitor opens your site, they see the Google Form as if it were part of your own design, but the form itself is still hosted and managed by Google. All responses are saved to your Google account and linked spreadsheet, so you do not lose any data by embedding the form on your domain.

Quick note before moving on The details matter here..

Why Embed a Google Form Instead of Just Sharing a Link?

There are several good reasons to embed rather than link:

  • Seamless user experience: Visitors do not have to open a new tab or deal with away from your website.
  • Higher completion rates: When the form appears right on the page, people are more likely to fill it out immediately.
  • Professional appearance: An embedded form looks more integrated and intentional than a raw URL.
  • Centralized data: You still collect all responses in Google Sheets, but the entry point lives on your site.
  • Easy updates: If you edit the form in Google Forms, the changes appear automatically on your website because the iframe pulls the live version.

Step-by-Step: How to Embed Google Form in HTML

You do not need advanced programming skills to complete this process. Follow these steps carefully, and your form will be live on your page in minutes.

Step 1: Create Your Google Form

Start by opening Google Forms and creating a new form or opening an existing one. Even so, add your questions, choose the question types, and customize the confirmation message that users will see after submission. Take a moment to pick a theme color, font, and header image that matches your website’s branding. Because the embedded form will inherit these visual settings, it is worth making it look polished before you generate the code.

Step 2: Get the Embed Code

Once your form is ready, click the Send button in the top-right corner. On top of that, in the send window, you will see three icons: email, link, and embed. Click the embed icon, which looks like angle brackets <>. A box will appear containing an HTML snippet that starts with <iframe. Click Copy to save the code to your clipboard No workaround needed..


Step 3: Paste the Code Into Your HTML

Open the HTML file where you want the form to appear. Here's the thing — paste the iframe snippet exactly where you want the form to render. Still, this could be a static . Still, html page, a template file in a CMS like WordPress (using a Custom HTML block), or a component in a framework like React or Vue. If you are editing a live site, save the file and refresh the page to confirm the form loads correctly.

Step 4: Adjust Dimensions for Your Layout

The default width of 640 pixels and height of 1200 pixels rarely fit every design. For responsive layouts, set width="100%" and control the max-width via CSS on a wrapper element. Practically speaking, a practical approach is to set a generous minimum height (e. Height is trickier because forms vary in length; a fixed pixel value often leaves awkward white space or cuts off content. Modify the width and height attributes to suit your container. g., 800px) and allow overflow, or use JavaScript to resize the iframe dynamically based on its content.

.form-wrapper {
  max-width: 720px;
  margin: 0 auto;
  overflow: hidden;
}
@media (max-width: 600px) {
  .form-wrapper iframe {
    height: auto;
    min-height: 600px;
  }
}

Step 5: Test on Multiple Devices

Open the page on desktop, tablet, and mobile. Verify that:

  • The form loads without horizontal scrolling. And - All question types (multiple choice, file upload, date picker) function correctly. Which means - The submit button is reachable and the confirmation message displays inside the iframe. - No console errors appear related to cross-origin policies or mixed content.

If the form feels cramped or too tall, return to Step 4 and tweak the height or wrapper styles Simple as that..

Advanced Customization Options

Remove the Google Branding Footer

The embedded form includes a “Powered by Google Forms” link at the bottom. While you cannot remove it via the iframe (it is part of the hosted document), you can visually hide it with CSS if your use case permits—though Google’s Terms of Service discourage obscuring attribution. A safer route is to accept the branding or link to the standalone form for users who prefer it Easy to understand, harder to ignore..

Pre-Fill Form Fields via URL Parameters

You can pass default answers into the embedded form by appending entry.xxxxxx=value parameters to the src URL. Get the entry IDs by inspecting the live form’s network requests or using the “Get pre-filled link” option in the Forms editor (three-dot menu → Get pre-filled link). Example:


It's useful for personalizing forms for logged-in users or campaign tracking Practical, not theoretical..

Lazy-Load the Iframe for Performance

Forms add weight to your page. Defer loading until the iframe nears the viewport:


The loading="lazy" attribute is supported in all modern browsers and prevents the form from blocking initial page render Worth keeping that in mind..

Common Issues and Fixes

Problem Cause Solution
Form shows “Loading…” indefinitely Browser blocks third-party cookies or cross-site tracking Ensure the iframe src uses https://docs.On the flip side, google. So naturally, com/forms/... /viewform?embedded=true (not edit or viewform without embedded=true). Some privacy extensions block Google domains; ask users to allow the domain. Still,
Horizontal scrollbar appears on mobile Fixed width="640" exceeds viewport Set width="100%" and constrain with a wrapper max-width.
Height cuts off long forms Static height too small Increase height, use a larger min-height, or implement iframe-resizer library for auto-sizing.

Real talk — this step gets skipped all the time.

Up Next

What's Just Gone Live

You Might Find Useful

Adjacent Reads

Thank you for reading about How To Embed Google Form In Html. We hope the information has been useful. Feel free to contact us if you have any questions. See you next time — don't forget to bookmark!
⌂ Back to Home