Keyhole Markup Language (.kml)
OGC StandardKeyhole Markup Language (KML) is the open XML standard for expressing geographic annotation and visualization, originally developed for Keyhole Earth Viewer (Google Earth) and standardized by the Open Geospatial Consortium (OGC).
Convert GEOJSON to KML
Free in-browser GEOJSON to KML converter. Convert files instantly on your device.
Inspect & Metadata
Operating systems and file analyzers identify KML files by inspecting the leading binary byte sequence:
Byte-Level Header Signature (Magic Bytes)
Operating systems and file analyzers identify KML files by inspecting the leading binary byte sequence:
HEX SIGNATURE (OFFSET 0):
3C 6B 6D 6CASCII REPRESENTATION: <kml
Standardization: OGC KML 2.3 Standard
Technical Specifications
| Container Architecture | XML-based geographic visualization grammar defining Placemarks, GroundOverlays, 3D Models, and Camera perspectives |
| Compression | Uncompressed XML text (compressed with ZIP as .kmz files) |
| Byte Endianness | UTF-8 / Unicode text stream |
| Color Spaces | AABBGGRR hexadecimal color strings |
| Channels & Structure | Placemarks, paths, polygons, 3D building models, photo overlays, and tour camera paths |
| Max Dimensions | WGS 84 coordinates: Longitude, Latitude, Altitude (in meters above sea level) |
| Transparency | Alpha transparency supported in AABBGGRR color strings and PNG overlays |
| Streaming & Progressive | NetworkLinks support dynamic streaming updates from remote geospatial servers |
Technical Comparison Matrix: KML vs Competitors
| Technical Attribute | KML (Current) | GEOJSON | GPX | KMZ |
|---|---|---|---|---|
| 3D Camera & Touring | Full camera tilt, heading, & fly-through tours | None (flat geometry properties) | Altitude elevation tracking | Full camera tilt & fly-through tours |
| Packaging Format | Plaintext XML document | Plaintext JSON document | Plaintext XML document | ZIP archive containing doc.kml |
| Color Format | AABBGGRR (Alpha-Blue-Green-Red) | CSS / Hex standard | None | AABBGGRR |
| Primary Destination | Google Earth & 3D GIS | Web maps (Mapbox, Leaflet) | Garmin & GPS fitness tracking | Google Earth standalone archive |
Common Corruption Modes & Hex Recovery Guide
Google Earth error: 'Parse error at line X: mismatched tag'.
Root Cause: Unclosed XML tag or unescaped ampersand in balloon description HTML.
Recovery: Repair XML syntax and wrap description in <![CDATA[...]]> using File2File KML Repair.
Security Analysis & Parser Attack Vectors
KML files support NetworkLinks and HTML description balloons that can trigger XXE, SSRF, or Cross-Site Scripting (XSS).
Known Attack Vectors
- Server-Side Request Forgery (SSRF) via malicious <NetworkLink> tags polling internal intranet endpoints.
- XSS injection via unsanitized HTML inside <description> tags executed in desktop or web Earth balloons.
- XML External Entity (XXE) injection during automated KML processing.
Defensive Best Practices: Disable external network fetching and sanitize balloon HTML content with DOMPurify.
Historical Origins & Milestones
Key Advantages & Pros
- Rich 3D Earth visualization: defines not just points, but 3D camera angles, heading, tilt, altitude, and fly-through tours.
- Supported natively by Google Earth, Google Maps, ArcGIS, and all professional desktop GIS software.
- Supports NetworkLinks, allowing Google Earth to dynamically stream live weather, flight tracking, and seismic updates.
Technical Limitations & Cons
- Verbose XML syntax results in larger file sizes than compact formats like GeoJSON.
- Colors use unconventional AABBGGRR hexadecimal order (Alpha-Blue-Green-Red) rather than standard RGBA.
- Complex 3D features (Tours, Models) are rarely supported on lightweight web mapping platforms.
Interesting Technical Trivia
- Keyhole Inc. was named after the historic KH (Keyhole) reconnaissance spy satellites launched by the United States during the Cold War.
- In KML, color values are written backwards as AABBGGRR: the first two characters are Alpha, then Blue, then Green, then Red.
- A '.kmz' file is literally just a standard .zip archive containing a single 'doc.kml' file and any embedded images or 3D models.
Frequently Asked Technical Questions
What is the difference between KML and KMZ?
KML is a plain text XML file. KMZ is a compressed ZIP file that contains a KML file alongside any custom map icons, textures, or 3D overlay images.
How can I convert KML to GeoJSON?
You can convert Google Earth KML files into clean GeoJSON for web mapping in one click using File2File.app directly in your browser.
Can I open a KML file in Google Maps?
Yes! In Google Maps, go to 'Saved' -> 'Maps' -> 'Create Map' (Google My Maps) and click 'Import' to upload your KML file.
Related KML Conversion Pairs
Convert GeoJSON vector features and properties into OGC KML format for Google Earth 3D mapping.
Convert Google Earth KML placemarks and polygon overlays into standard web-friendly GeoJSON.
Convert Garmin/Strava GPX GPS tracks and activity waypoints into 3D Google Earth KML flight paths.
Extract GPS waypoint and route trackpoints from Google Earth KML files into standard GPX format.