# .kml MIME Type: application/vnd.google-earth.kml+xml

> Keyhole Markup Language — placemarks, paths and overlays for Google Earth and Google Maps.

- MIME type: `application/vnd.google-earth.kml+xml`
- Extensions: .kml
- Content-Type header: `application/vnd.google-earth.kml+xml; charset=utf-8`
- Compress in transit: yes

## Good to know

- Zipped KML uses `.kmz` and `application/vnd.google-earth.kmz`: a ZIP archive with a main `.kml` file (conventionally `doc.kml`) and its images.
- KML writes coordinates as `longitude,latitude[,altitude]` — the same order as GeoJSON.

## Server configuration

### nginx (inside the types block in mime.types)

```
application/vnd.google-earth.kml+xml kml;
```

### Apache (.htaccess or server config)

```
AddType application/vnd.google-earth.kml+xml .kml
```

### Express

```
res.set("Content-Type", "application/vnd.google-earth.kml+xml; charset=utf-8");
```

### Python

```
import mimetypes

mimetypes.add_type("application/vnd.google-earth.kml+xml", ".kml")
```

### HTML file input

```
<input type="file" accept=".kml,application/vnd.google-earth.kml+xml">
```

## FAQ

### What is the MIME type for .kml files?

`application/vnd.google-earth.kml+xml`.

### What Content-Type header should a .kml file be served with?

`Content-Type: application/vnd.google-earth.kml+xml; charset=utf-8`. As a text format, include the charset so browsers don't guess the encoding. It compresses well, so let the server apply gzip or Brotli.

## Related types

- [.geojson — application/geo+json](https://www.devkult.com/mime/geojson.md)
- [.gpx — application/gpx+xml](https://www.devkult.com/mime/gpx.md)
- [.xml — application/xml](https://www.devkult.com/mime/xml.md)

Open the interactive page: https://www.devkult.com/mime/kml