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.
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&q=Eiffel%20Tower%2C%20Paris&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 only | https://www.google.com/maps/embed/v1/place?key=YOUR_API_KEY&q=Eiffel%20Tower%2C%20Paris&zoom=14 |
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
- Choose the type. The official Maps Embed API (needs a free key) or a quick embed without a key.
- Enter the place or route. An address, business name, search, two places for directions, or coordinates for a view or Street View.
- Set the size. Width and height, and whether it should shrink to fit phones.
- Copy the code. Paste the iframe into your site's HTML, page builder 'HTML' block or CMS embed field.
- 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¶meters. 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
Draw on Map
Draw freehand, lines, shapes and markers on a real map, see each line's length and each shape's area, label them and download the drawing as GeoJSON, KML or GPX.
OpenStreetMap tiles; geodesic lengths and ellipsoidal areas
Map Legend Maker
Build a legend for any map — colours, area, point, pin and line symbols, labels, columns and a title — and download it as a PNG (transparent if you like) or SVG.
Made in your browser (SVG)
Color a Map
Click to colour US states, world countries or one continent, add a title and legend, or paste a list or numbers to shade them, then download the map as PNG, SVG or PDF.
Census 2024 state boundaries; Natural Earth 1:50m countries
County Map Maker
Make a county map of the whole US or any state: click counties to colour them or paste county names or FIPS codes with groups or numbers, add a legend and download PNG, SVG or PDF.
Census 2024 county boundaries (1:500,000)
ZIP Code Map Maker
Paste up to 300 ZIP codes, with group names or numbers if you like, and see their real boundaries coloured on a map, with a legend and GeoJSON or KML download.
Census 2020 ZIP Code Tabulation Areas (TIGERweb)
Pin Map Maker
Drop pins on a map by address or click, give each a label and colour, then share the map with a link or download it as KML, GeoJSON or CSV — no account needed.
OpenStreetMap tiles; Photon geocoder