Skip to main content

How to Embed Google Map in HTML: Copy-and-Paste Code Generator

If you are wondering how to embed Google Map in HTML, there are two routes: the Share menu in Google Maps, and the Maps Embed API with a key. The first needs no account. The second gives you more control over zoom and map type.

API key required: the generated code uses the placeholder YOUR_GOOGLE_MAPS_API_KEY. Replace it with your own Google Maps API key from the Google Cloud Console.
1: world20: building

px or %

px only

Enter an address to generate the embed code.

In short: This generator builds the iframe code for the second route and shows the steps for the first. Enter a business or address, choose the options and copy the result.

A map on your contact page helps customers find you and gives Google one more clear sign of where you operate.

How to embed a Google Map in HTML in two ways

The quick way: open Google Maps, search your business, choose Share, open the Embed a map tab, copy the HTML and paste it into your page. The other way uses the Maps Embed API with a key from Google Cloud Console and gives you control over zoom and map type.

The Share method needs no key and takes a minute. The API method is better when you manage several pages or want to change the map without rebuilding the code by hand.

This tool produces the API version. For the Share version, follow the steps above and paste the iframe it gives you.

Using the generator step by step

Type your business name and address, pick the map type and zoom level, and choose a responsive or fixed size. Copy the code, replace YOUR_API_KEY with your own key and paste it where the map should appear. Then load the page and check the pin sits on your business.

Use your full business name plus the city for the best match. If the wrong place appears, switch to a Place ID, which points to exactly one location.

Set a short iframe title such as "Map showing our shop location". Screen readers read it out, and it is good accessibility practice.

Get and protect your Google Maps API key

Create a project in the Google Cloud Console, enable the Maps Embed API and create an API key. Then restrict the key to your website address so nobody else can use it. Google asks for billing details when you set up a project, even for free products.

Restricting the key matters because it sits in your page source for anyone to read. Without a restriction, someone could copy it. Google's pricing page lists Maps Embed API usage as free, but check the current terms before you launch.

Make the embedded map responsive

A fixed width and height break on phones. The responsive option wraps the iframe in a container with a 16:9 ratio and sets the iframe to fill it. The map then scales with the screen. Add loading="lazy" so the map only loads when a visitor scrolls near it.

Lazy loading keeps the map from slowing the rest of the page. On a contact page the map often sits near the bottom, so most visitors never pay the loading cost unless they scroll.

Where a map helps your local SEO

Put the map on your contact page and on each location page, next to your name, address and phone number exactly as they appear on your Google Business Profile. The map itself is not a ranking trick. It confirms the location for visitors and keeps your details consistent.

If you serve customers at their homes, a map of your service area on the city page can help. Do not show a home address you have hidden on your profile.

Embed a map on WordPress, Wix, Squarespace or Shopify

Every major site builder has a custom HTML or embed block. Paste the iframe code into it, save and preview. You do not need a plugin for a simple map.

In WordPress, add a Custom HTML block. In Wix, Squarespace and Shopify, look for an Embed or Code block in the page editor and paste the generated code.

If the map does not show, check that the block accepts raw HTML and that your plan allows custom code.

Make the embedded map load fast and stay accessible

Add loading="lazy" to the iframe so the map loads only when visitors scroll near it, and add a clear title attribute so screen readers can announce what the map shows.

A map is heavier than an image. Placing it lower on the page, or on your contact page, keeps your main content quick.

Always show your address as text next to the map. The map helps visitors, but the text is what search engines and screen readers read first.

Fix the most common embed problems

A blank map, the wrong location or a gray box usually comes from a broken iframe code, a restricted API key or a block that strips code. Check those three first.

If the pin is in the wrong place, search for your business name rather than a street address, or paste the exact address as it appears on your profile.

If you use an API key, confirm it is allowed to run on your domain and that billing is set up in your Google Cloud account.

  • Test the page in a private window
  • Check the browser console for blocked content
  • Confirm the key restrictions match your domain

Keep the map consistent with your Google Business Profile

The place on your map should match the name, address and pin on your Google Business Profile. Mismatched details confuse visitors and weaken your local signals.

Add the embed to your contact page and to location pages, next to the same name, address and phone details shown on your listing.

If you serve customers at their homes and hide your address, show your service area in text and do not publish a precise pin you do not want visible.

Make your location easier to find

A map is one piece of local visibility. See how we optimize the profile that powers your Maps listing. Book a free 30-minute audit.

Sources: Google Maps Help: Share or embed a map, Google Maps Platform: Maps Embed API overview, Google Maps Platform pricing.

Frequently asked questions

Not if you use the Embed a map option in the Share menu on Google Maps. The Maps Embed API format that this generator produces does need a key. Create one in the Google Cloud Console and restrict it to your site.

Share this page

We audit your profile. Then we talk.

Book 30 minutes on video with the founder. We prepare your local SEO audit, go through it together, and you decide.

Free audit, reply within 24 hours. You sign nothing today.
  1. 01
    You book your call
    Pick a 30-minute slot in the founder’s calendar.
  2. 02
    We run your audit
    We review your profile, your local opportunities and your competitors before the call.
  3. 03
    We go over it on video
    We walk you through the results and talk it over openly, whether we work together or not.

ICHI, local SEO assistant

Ichiban SEO is the local SEO agency that specializes in Google Maps, founded by Nathanaël Butet. ICHI answers anything about the agency in a few seconds.

What we do

Local SEO only: getting your business into the Google Maps local pack for your city and your trade.

The guarantee

Google Business Profile optimized within 24h of getting your access, or your 2nd month is free.

Your competitor

One professional per city and per industry. Your direct competitor cannot hire us.

Pricing

Ascension: $497/month. Domination: $897/month. No setup fee.

The method

Optimized Google profile, consistent listings, customer reviews, local pages, proximity links, rank tracking.

The free audit

30 minutes on a video call with Nathanaël: we check whether your spot is open and size your potential.

Ask ICHI

Book my free audit

ICHI is an AI and can make mistakes. For advice on your case, book the free audit with the team.