A. KML → GeoJSON → Tippecanoe MBTiles (vector):
ogr2ogr -f GeoJSON input.geojson input.kml
tippecanoe -o output.mbtiles -Z 0 -z 14 --drop-densest-as-needed input.geojson
B. KML GroundOverlay image → MBTiles (raster) via GDAL: convert kml to mbtiles
# produce geotiff with appropriate bounds (from KML LatLonBox)
gdal_translate -of GTiff -a_ullr left top right bottom -a_srs EPSG:4326 overlay.png overlay_geo.tif
gdalwarp -t_srs EPSG:3857 overlay_geo.tif overlay_3857.tif
gdal_translate -of MBTILES -co TILE_FORMAT=PNG overlay_3857.tif overlay.mbtiles
C. Rasterized KML polygons to MBTiles:
ogr2ogr -f GeoJSON data.geojson input.kml
# rasterize at zoom X resolution — determine extent and pixel size based on zoom
gdal_rasterize -burn 1 -ts WIDTH HEIGHT -te xmin ymin xmax ymax data.geojson raster.tif
gdal_translate -of MBTILES raster.tif output.mbtiles
If you have a smaller file and don't want to install software, Mapshaper is a fantastic browser-based tool. Best for: Use in Mapbox
Note: This method works best for files under 50MB. Large KML files will crash the browser tab. or mobile apps (OSMAnd
Best for: Use in Mapbox, Leaflet, or mobile apps (OSMAnd, Guru Maps).
If you want a static image layer: