PlainTools

Google Maps Embed Code Generator

Make the iframe code to put a Google Map on your website — a place, search, directions, view or Street View — with size, responsive layout and accessibility title set for you.

Map Makers & GIS FilesWorldwideSource: Google Maps Embed API parameters (Google documentation)Free, no sign-up

Paste your API key to make the code work (the code below has a placeholder).

Embed code<div style="position:relative;width:100%;max-width:600px;aspect-ratio:600/450"> <iframe src="https://www.google.com/maps/embed/v1/place?key=YOUR_API_KEY&amp;q=Eiffel%20Tower%2C%20Paris&amp;zoom=14" title="Map" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" style="position:absolute;inset:0;width:100%;height:100%;border:0"></iframe> </div>
Map URL onlyhttps://www.google.com/maps/embed/v1/place?key=YOUR_API_KEY&q=Eiffel%20Tower%2C%20Paris&zoom=14
The preview loads the map from Google.

URL parameters follow Google's Maps Embed API documentation; Google states the Embed API is offered at no charge (usage and billing). This page only writes the code — it is not affiliated with Google.

How to embed a Google Map on your website

  1. Choose the type. The official Maps Embed API (needs a free key) or a quick embed without a key.
  2. Enter the place or route. An address, business name, search, two places for directions, or coordinates for a view or Street View.
  3. Set the size. Width and height, and whether it should shrink to fit phones.
  4. Copy the code. Paste the iframe into your site's HTML, page builder 'HTML' block or CMS embed field.
  5. Preview. Press Preview to see the map exactly as visitors will.

Where people embed a map

Contact page

Show your shop or office location.

Event page

Map of the venue with directions.

Real-estate listing

Street View of a property.

Store locator

A search for your brand in a city.

Wedding website

Directions from the ceremony to the reception.

Blog posts

A view of the place you are writing about.

WordPress, Wix and Squarespace

All accept iframe code in an HTML or embed block.

Accessibility

A descriptive title lets screen-reader users know what the frame is.

How the code is built

The Maps Embed API builds the map from a URL of the form https://www.google.com/maps/embed/v1/MODE?key=KEY&parameters. The modes and parameters used here — place, search, directions, view and streetview, with q, origin, destination, mode, center, zoom, maptype, location, heading, pitch and fov — follow Google's Maps Embed API documentation. Google requires an API key for this API and states that it is offered at no charge.

The 'quick embed' option uses the older maps.google.com link with output=embed. It works without a key today but is not documented by Google, so it may change.

The code adds loading="lazy" so the map loads only when scrolled into view, allowfullscreen, a referrer policy, and a title for screen readers. The responsive version wraps the iframe so it keeps its shape on small screens.

Your key never leaves your browser except inside the code you copy and, if you press Preview, in the request to Google that draws the preview. This site is not affiliated with Google.

Frequently asked questions

Do I need an API key?

For the official Maps Embed API, yes — Google requires one, and states the Embed API is free to use. The quick embed works without a key but is undocumented.

How do I get a key?

Create a project in Google Cloud, enable the Maps Embed API and create a key. Restrict it to your website's address so nobody else can use it.

Is it safe to put my key in my website?

Embed keys are visible in page source by design. Restricting the key to your domain and to the Maps Embed API is what protects it.

Why does my map say 'This page can't load Google Maps correctly'?

The key is missing, not enabled for the Maps Embed API, or restricted to a different domain.

Can I show several pins?

Not with the Embed API's place mode. Use search mode for a category, or a custom map made in Google My Maps, which has its own embed option.

How do I make it responsive?

Tick 'Responsive' — the code keeps the map's shape and fills the width of its container.

Related tools