GPKG to GeoJSON Converter

Drop a GeoPackage file and download GeoJSON in seconds. Processed entirely in your browser using WebAssembly — your data never leaves your machine. No upload. No account. No cost.

100% Private — No Upload Multi-Layer Support All WKB Geometry Types SRS Detection
Share this tool

layers found ·

of layers selected

Converting…

/ features processed

Conversion complete

GeoJSON files ready

How the Converter Works

Browser-Side Conversion Pipeline

Your file never leaves the browser. sql.js (SQLite compiled to WebAssembly) opens the GeoPackage, queries each feature layer, and a custom WKB parser converts binary geometry to GeoJSON coordinates.

.gpkg File SQLite binary dropped by user sql.js WASM browser SQLite queries layers + rows WKB Parser all geometry types Point to GeomCollection GeoJSON Output RFC 7946 format downloaded by browserSTEP 1 STEP 2 STEP 3 STEP 4🔒 All processing happens in your browser — no data is transmitted

GPKG Geometry Blob Structure

Every geometry in a GeoPackage is stored as a BLOB column with an 8-byte GPKG header (magic, version, flags, SRS ID) followed by an optional bounding-box envelope, then the standard OGC WKB geometry.

GeoPackage Geometry BLOB — byte layout GP 2 B v1 1 B flags 1 B SRS ID 4 B Envelope bbox XY[Z][M] 0–64 B B.Ord 1 B Type 4 B Coordinates (X, Y [,Z] [,M] Float64 pairs) variable GPKG Binary Header Well-Known Binary (WKB) GeometryType codes: 1=Point 2=LineString 3=Polygon 4=MultiPoint 5=MultiLineString 6=MultiPolygon 7=GeometryCollection Z variants +1000 (e.g. 1001=PointZ) · M variants +2000 · ZM variants +3000

What Is a GeoPackage (.gpkg) File?

A GeoPackage is an OGC-standard, SQLite-based geospatial container that stores vector features, raster tiles, attribute tables, and coordinate reference metadata in a single portable file. Standardised in 2014 (OGC 12-128), GeoPackage has replaced Shapefile as the default exchange format in most GIS workflows because it supports multiple geometry types, eliminates the three-file (.shp/.dbf/.shx) overhead, and lifts the 2 GB Shapefile size limit.

GeoJSON (RFC 7946) is the web-native counterpart: a human-readable JSON format that every modern mapping library — Leaflet, Mapbox GL JS, deck.gl, Google Maps — accepts without a plugin. Converting from GPKG to GeoJSON is the final step before publishing spatial data on the web or loading it into a NoSQL/document database.

This converter reads your GeoPackage entirely in the browser using sql.js (SQLite compiled to WebAssembly) and a hand-written WKB binary parser that handles all geometry types defined in the ISO 19125 and OGC WKB specifications — including Z, M, and ZM coordinate variants.

Format Comparison: GeoPackage, GeoJSON, Shapefile, and KML

FeatureGeoPackageGeoJSONShapefileKML
FormatBinary (SQLite)Text (JSON)BinaryText (XML)
Multi-layerYesNoNoYes
Any SRSYesWGS 84 onlyYesWGS 84 only
Column name lengthUnlimitedUnlimited10 charsUnlimited
File countSingle fileSingle file3–6 filesSingle file
Web-nativeNoYesNoPartial
OGC standardYesYes (RFC 7946)No (ESRI)Yes (OGC KML)

Convert GPKG to GeoJSON with GDAL and Python

For files larger than 1 GB, automated pipelines, or server-side workflows, use GDAL's ogr2ogr utility or the fiona Python library. Both are free, open-source, and support all geometry types and coordinate systems.

TaskCommand / Code
All layersogr2ogr -f GeoJSON output.geojson input.gpkg
One layerogr2ogr -f GeoJSON output.geojson input.gpkg layer_name
Reproject to WGS 84ogr2ogr -f GeoJSON -t_srs EPSG:4326 output.geojson input.gpkg
Python (Fiona)
import fiona, json with fiona.open("input.gpkg") as src: fc = dict(type="FeatureCollection", features=list(src)) print(json.dumps(fc))
GeoPandas
import geopandas as gpd gdf = gpd.read_file("input.gpkg") gdf.to_file("output.geojson", driver="GeoJSON")

Frequently Asked Questions

What is a GeoPackage file and why is it used in GIS?

A GeoPackage (.gpkg) is an OGC standard (12-128r6) for encoding geospatial information in a SQLite database. It was designed to overcome the limitations of Shapefile — no 10-character column name limit, no 2 GB file size cap, multi-layer support, and a single portable file. QGIS, ArcGIS Pro, PostGIS, GDAL, and most modern GIS tools support GeoPackage natively. It is particularly common in offline and mobile GIS applications where a self-contained, cross-platform format is needed.

How does this converter work without uploading my file?

When you drop a .gpkg file, the browser reads it using the FileReader API directly into memory. A small WebAssembly build of SQLite called sql.js opens the database and queries the geometry layers. A custom JavaScript WKB parser reads the raw binary geometry blobs and converts each vertex to GeoJSON-style [longitude, latitude] coordinate arrays. The result is serialised to a JSON string and offered as a download — entirely without a network request.

What geometry types are supported?

All seven base geometry types from the OGC WKB specification are supported: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection. Z (3D), M (measured), and ZM coordinate variants (WKB type codes 1001–3007) are also handled — the extra coordinates are silently dropped since GeoJSON only supports 2D or 3D (longitude, latitude, altitude). Null geometries (features with no spatial data) are output as "geometry": null, which is valid GeoJSON.

My GPKG uses a projected coordinate system — will the GeoJSON be correct?

RFC 7946 (the GeoJSON standard) requires coordinates to be in WGS 84 geographic coordinates (EPSG:4326), expressed as [longitude, latitude] decimal degrees. This converter outputs coordinates exactly as they are stored in the GPKG — it does not reproject. If your source data is in a projected CRS such as UTM or a national grid, the resulting GeoJSON will contain metre-based easting/northing values that most web mapping libraries will misplace. Use ogr2ogr -t_srs EPSG:4326 to reproject before or after conversion.

How large a GeoPackage can I convert in the browser?

In practice, files under 200 MB convert quickly (under 30 seconds on a modern laptop). Files from 200 MB to 500 MB work but may take a minute and consume significant RAM. Files above 500 MB risk running into browser memory limits, especially on devices with 4–8 GB RAM. The converter hard-limits at 1 GB. For larger files, use GDAL (ogr2ogr), which processes data in streaming chunks without loading the entire database into memory. The converter yields to the browser's rendering thread every 500 rows to keep the UI responsive during long conversions.

Can I convert multiple layers from one GeoPackage at once?

Yes. After the converter detects all feature layers in the GeoPackage (by querying the gpkg_geometry_columns system table), you can select which layers to include before clicking Convert. Each selected layer produces a separate .geojson file — one download per layer. A "Download All" button appears for multi-layer results. Note that raster tile layers are not supported; only vector feature layers are converted.