toGeoJSON turns KML & GPX into GeoJSON

⬇ togeojson.js less than 10 kB minified

or clone & contribute on github

toGeoJSON is a simple way to use KML and GPX formats with modern web tools like Leaflet and MapBox. It's simple, written in plain, dependency-free JavaScript and designed to work across browsers and in node.js.

Use this page to test it out, or download it to integrate into your application.


  • LineString, Polygon, MultiPolygon, MultiLineString, Point, MultiGeometry
  • ExtendedData, SimpleData, name, description


  • Tracks, Routes, and Waypoints
  • Standard metadata