Convert Shapefile (SHP) to KML

This converter turns a shapefile into a KML file for Google Earth or Google My Maps, reprojecting it to WGS84 and keeping the attributes as placemark data. The shapefile is processed in your browser and is not uploaded. Shapefiles have no colors, so points get the standard pushpin and lines and outlines are red. The original projection is not stored in the KML, and a missing .prj may require an EPSG code.

Did a file not convert correctly? E-mail [email protected], ideally with a small sample file, and it will be fixed.

Key facts

Shapefile to KML: why convert

KML is the easiest way to show GIS data to people who do not use GIS. Anyone can open it in Google Earth on the web, on a desktop or on a phone, or import it into Google My Maps and share a link. This converter turns a shapefile into a KML file in your browser. It reads the coordinate system from the .prj file and reprojects to WGS84 longitude and latitude, the only coordinate system KML allows. Attributes from the .dbf table are kept as data on each placemark, and you decide which field becomes the placemark name that Google Earth shows on the map. Add the shapefile as a .zip or as separate files; nothing is sent to a server.

How to convert Shapefile to KML

  1. Drop a .zip with your shapefile, or select the .shp, .shx, .dbf and .prj files together.
  2. Choose the field to use for placemark names, or keep Automatic.
  3. Click Convert to KML and open the downloaded file in Google Earth.

What changes when you convert

Always reprojected to WGS84

KML coordinates are longitude and latitude on WGS84 by definition. Shapefiles in a State Plane system, a UTM zone or a national grid are reprojected using the .prj file. The original projection is not stored in the KML, so keep the shapefile if you need it later. If the .prj is missing and the coordinates are not longitude and latitude, you are asked for the EPSG code.

Attribute types turn into text

Each attribute is written as KML extended data, with a schema that records whether a field is text, a whole number or a decimal. Google Earth, however, shows every value as plain text in the placemark balloon, and date fields are written as text in the form 2024/05/01.

Choosing the placemark name

Google Earth labels each placemark with its name, but shapefiles rarely have a field called Name. Automatic uses a field called Name if there is one, then a text field with name, title or label in it, then the first text field. You can pick any other field, or No names. The other attributes are shown as a data table in the placemark balloon.

Default styles

A shapefile has no colors. Points get Google Earth's standard pushpin, and lines and polygon outlines are drawn in red with polygons unfilled. To change this in Google Earth Pro, right-click the folder, open Properties (Get Info on a Mac) and set the style and color.

Several shapefiles become one KML

When your .zip holds more than one shapefile, you get a single KML with one folder per shapefile, so roads, parcels and points of interest can be switched on and off separately in Google Earth.

Example: car parks in the Peak District, from British National Grid to Google Earth

The example file peak_district_car_parks.zip holds a point shapefile in British National Grid (OSGB36, EPSG:27700) with .shp, .shx, .dbf and .prj but no .cpg, and its table is saved in Windows-1252, as in many older exports from ArcGIS or MapInfo. The fields are NAME, SPACES and CHARGE, with a £ sign and an é in the text. Mam Nick car park lies at easting 412646, northing 383529. The car parks are made-up data at approximate places.

After you drop it, the page says "Ready: 3 features in 1 layer." and shows OSGB36 / British National Grid as the coordinate system. With "Placemark names from" set to Automatic, NAME becomes the name of each placemark, with the accent intact: "Fairholmes Café car park". peak_district_car_parks.kml is in WGS84 longitude and latitude; easting 412646, northing 383529 becomes -1.8115, 53.3485. SPACES is stored as a whole number in the extended data and CHARGE as text, "£5 all day".

peak_district_car_parks.zip                       peak_district_car_parks.kml (WGS84)
└─ peak_district_car_parks.shp/.shx/.dbf/.prj  →   └─ 3 placemarks: NAME → name,
   (British National Grid, Windows-1252)               SPACES (int), CHARGE as extended data

Download the example file peak_district_car_parks.zip (1 KB) and convert it above

Common problems in QGIS, ArcGIS and Google Earth, and what this page does

Next: convert the KML back to a shapefile, pack the KML as a KMZ or view the shapefile first.

About the formats

Shapefile

The Esri Shapefile is the most widely used GIS vector format. A single "shapefile" is really a set of files with the same name: .shp holds the geometry, .shx an index, .dbf the attribute table, and the optional .prj the coordinate system and .cpg the text encoding.

  • Needs at least .shp, .shx and .dbf. Select them together or as one .zip.
  • Field names are limited to 10 characters and text values to 254 characters.
  • Each shapefile holds one geometry type only: points, lines or polygons.
  • Without a .prj file the coordinate system is unknown.

KML

KML (Keyhole Markup Language) is the XML format behind Google Earth and Google My Maps, and an OGC standard since 2008. Besides geometry it can hold styles, icons, folders and descriptions in HTML.

  • Always WGS84 longitude, latitude and optional altitude.
  • Folders group placemarks; each folder can become its own layer when converting.
  • Styles (colors, line widths, icons) are specific to KML and Google Earth.

Frequently asked questions

Can I import the KML into Google My Maps?

Yes. In My Maps, add a layer, click Import and choose the KML. My Maps uses the placemark name as the title and shows the other attributes in the details. It limits how many features one layer can hold, so very large shapefiles may need to be split.

What happens to polygons with holes and multipart features?

Holes are written as inner boundaries and multipart features as a KML MultiGeometry, so they look the same in Google Earth as in your GIS.

Why does my data show up in the wrong place in Google Earth?

Usually the .prj file is missing or wrong. Check the coordinate system shown in the summary before converting; if it is not what you expect, fix the .prj file. If there is no .prj, enter the right EPSG code when asked.

Are Z values kept?

Yes, the heights are written to the KML, but no altitude mode is set, so Google Earth draws the features on the ground. To show them at their height, change the altitude mode on the Altitude tab of a placemark's Properties in Google Earth Pro.

Is my shapefile uploaded?

No. The conversion runs in your browser and the files stay on your computer.

Step-by-step guides