Live Online ConverterChannel: geopackagegeojson

GeoPackage to GeoJSON Converter

Convert a GeoPackage file into a GeoJSON file.

Extract a tabular spatial layer contained inside a portable GeoPackage (SQLite) container and translate it into a single GeoJSON file. High-performance OGR drivers handle indexing definitions perfectly and deliver standard text streams.

Drag file here to convert, or select file

Supported file extension: .gpkg • Max 50MB

Channel: Direct Stream ModeGDAL Driver Operational

Specification Rules

  • Publish spatial tables stored in database containers directly to the web
  • Share vector features with non-GIS developers as raw JSON records
  • Incorporate robust geometry pipelines into serverless web applications
  • If the GeoPackage has multiple separate tables, only the first layer is parsed
  • Translating hundreds of thousands of polygons can trigger high bandwidth loads
  • Spatial indexes are stripped because JSON is a raw, non-indexed text format

GDAL Direct Equivalent Terminal Command

sh — gdalready
$ogr2ogr -f GeoJSON output.geojson input.gpkg

When to use this conversion

Convert when you have a single layer in a GeoPackage that needs to feed a web map, a REST API, or a tool that only consumes JSON. Pick this conversion for one-off web publishing, not for multi-layer database distribution.

Technical Details

GDAL opens the .gpkg as a SQLite database, locates the requested layer in gpkg_contents, reads geometries from the WKB blobs (stripping the GeoPackage header), and writes an RFC 7946 FeatureCollection. The output is reprojected to WGS 84 if the source layer has a different CRS. SQLite column types are mapped to JSON-friendly equivalents — INTEGER and REAL become JSON numbers, TEXT stays TEXT, BLOB is base64-encoded.
Output file size

GeoJSON is typically 3–5× the size of the source GeoPackage layer. The ratio is higher for layers with many small features (per-feature JSON overhead) and lower for layers with a few large polygons (geometry dominates).

Common Errors & Fixes

  • Multi-layer GeoPackage and ambiguous target: GDAL converts the first layer only. Fix: name the layer explicitly with `ogr2ogr ... input.gpkg layer_name`.
  • Source CRS not WGS 84: output coordinates are in the wrong system if -t_srs is omitted. Fix: always pass -t_srs EPSG:4326 -lco RFC7946=YES.
  • Output file enormous: GeoJSON text overhead can push file size past browser-friendly limits. Fix: trim coordinate precision with -lco COORDINATE_PRECISION=6 or switch to TopoJSON.
  • BLOB columns serialised as long base64 strings: bloats the output. Fix: use -select to drop blob columns before export.

Alternative Tools

  • QGIS: open the .gpkg, right-click the layer → Export → Save Features As → GeoJSON
  • ogr2ogr CLI: ogr2ogr -f GeoJSON output.geojson input.gpkg layer_name
  • Python: geopandas.read_file("input.gpkg", layer="my_layer").to_file("out.geojson", driver="GeoJSON")
  • ogrinfo -al -geom=YES input.gpkg for a quick inspection before exporting

Frequently Asked Questions

What happens if my GeoPackage contains multiple layers?

Our online utility automatically converts the first primary active table inside your SQLite file. For multi-layer extraction, the GDAL command line is required.

Why is the output GeoJSON so much larger than the GeoPackage?

GeoPackage stores geographical vectors in compressed binary formats inside SQLite. GeoJSON resolves everything into human-readable text characters, increasing bulk.

Is coordinate spatial integrity preserved?

Yes. Spatial boundaries, projections, and attributes map directly to GeoJSON feature lists.

Related Transformations Map