What is MIME type "application/vnd.google-earth.kml+xml"?

A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.

application/vnd.google-earth.kml+xml is a file type for geospatial data. It uses XML to structure geographic details.
It is chiefly used to display maps, routes, and spatial features. The data is processed by mapping software like Google Earth.
This MIME type supports files such as KML and its compressed version KMZ.
The format is based on XML, making it both human-readable and easy for machines to parse.
For more technical details, see the KML Documentation.

Associated file extensions

Usage Examples

HTTP Header

When serving content with this MIME type, set the Content-Type header:


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

HTML

In HTML, you can specify the MIME type in various elements:


    <a href="file.dat" type="application/vnd.google-earth.kml+xml">Download file</a>    
  

Server-side (Node.js)

Setting the Content-Type header in Node.js:


    const http = require('http');    
    
    http.createServer((req, res) => {    
      res.setHeader('Content-Type', 'application/vnd.google-earth.kml+xml');    
      res.end('Content here');    
    }).listen(3000);    
  

Associated file extensions

FAQs

What is the correct MIME type for KML files?

The official MIME type is application/vnd.google-earth.kml+xml. Using this specific type instead of generic XML types ensures that browsers and operating systems recognize the file as a geospatial map intended for applications like Google Earth.

How do I configure Apache to serve KML files correctly?

You should add the type definition to your .htaccess file or main configuration. Add the line AddType application/vnd.google-earth.kml+xml .kml to ensure the server sends the correct headers to the client.

What is the difference between the MIME types for KML and KMZ?

application/vnd.google-earth.kml+xml is used for uncompressed KML files which are text-based XML. In contrast, compressed KMZ archives require the MIME type application/vnd.google-earth.kmz. Using the wrong type will often prevent the file from opening correctly.

Why does my KML file display as code in the browser instead of downloading?

This happens if the server identifies the file as text/xml or text/plain. To force a download or trigger the mapping application, ensure the server sends the Content-Type: application/vnd.google-earth.kml+xml header.

How do I add KML support to Nginx?

You need to update your mime.types file or add a directive inside your server block. Include the mapping: application/vnd.google-earth.kml+xml kml; and reload the Nginx service.

How do I configure IIS to serve KML files?

Open IIS Manager, select your site, and double-click the MIME Types feature. Click Add in the Actions pane, set the file name extension to .kml, and set the MIME type to application/vnd.google-earth.kml+xml.

General FAQ

What is a MIME type?

A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.

MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.

MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.

How do I find the MIME type for a file?

You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.

Why are multiple MIME types listed for one extension?

Different applications and historical conventions may use alternative MIME identifiers for the same kind of file. Showing them all helps ensure compatibility across systems.