GML GEOJSON
File conversion

Convert GML to GEOJSON

QUICK ANSWER
Is it possible to convert GML to GEOJSON?
Yes - GML converts to GEOJSON.

The fastest path is one ogr2ogr command from GDAL; QGIS provides a GUI alternative. Always reproject to WGS 84 (EPSG:4326) during export, as the GeoJSON spec requires geographic coordinates.

Also to GEOJSON: SHP · OSM · GPX

On this page

Tested on macOS, Windows & Linux
Last verified Oct 2026

More free converters

HEIC, PNG, WEBP, MP3 and more - every tool here is free.

Open the toolbox

Why convert GML to GEOJSON?

GML (Geography Markup Language) is an XML-based OGC standard for geographic features introduced in 2000. GeoJSON stores the same features as JSON and is the standard input for web mapping libraries such as Leaflet and Mapbox. Web tools rarely read .gml directly, making conversion the practical step before publishing geographic data on a map.

How to convert GML to GEOJSON

GDAL/OGR (ogr2ogr) OPEN-SOURCE

Run ogr2ogr -f GeoJSON out.geojson in.gml in a terminal; add -t_srs EPSG:4326 to reproject to WGS 84 if the source CRS is not already geographic.

QGIS FREE

Add the .gml as a vector layer, right-click it in the Layers panel, choose Export > Save Features As, set format to GeoJSON, and set CRS to EPSG:4326.

About these formats

Quality & what to watch

  • GeoJSON (RFC 7946) requires WGS 84 geographic coordinates; always reproject during export if the source CRS is a local projected system.
  • Feature attributes and geometry (points, lines, polygons) carry over intact to the GeoJSON properties and geometry objects.
  • Both formats are text-based; the output .geojson file is similar in size to or slightly smaller than the source .gml.

Frequently asked questions

Does QGIS include GDAL?
Yes - QGIS bundles GDAL, so installing QGIS also gives you the ogr2ogr command-line tool.
Will mixed geometry types in a GML file cause problems?
No - GeoJSON supports mixed types via a FeatureCollection, so the conversion handles them without data loss.
Why does my GeoJSON display incorrectly on a web map?
The source CRS is likely not WGS 84; re-run with -t_srs EPSG:4326 in ogr2ogr or select EPSG:4326 in the QGIS export dialog.