Vector Tile Packager
Convert GeoJSON to Mapbox Vector Tiles (MVT) for preview
What Are Mapbox Vector Tiles (MVT)?
Mapbox Vector Tiles (MVT) are a compact binary format for serving vector geographic data as tiles, the same way raster tiles work for satellite imagery. Each tile contains the geometry, attributes, and styling hints for a small slice of the world at a specific zoom level. The advantage over GeoJSON is that the client only downloads the tiles for the current view, not the entire dataset, making MVT the foundation of fast, smooth, infinitely-zoomable web maps in Mapbox GL JS, MapLibre GL JS, and OpenLayers.
The Vector Tile Packager on gis.tools is a free, browser-based tool that converts a GeoJSON file into a set of MVT tiles you can preview, inspect, and use for testing. Drop a GeoJSON in, set the zoom range, and the packager slices the data into tiles using the same algorithms as Mapbox's tippecanoe and geojson-vt libraries. Everything runs locally β no Mapbox account, no Mapbox uploads, no telemetry.
How Vector Tile Packaging Works
The packager uses a streaming GeoJSON reader to parse the input, then runs a tiling algorithm that:
- Determines the bounding box of each feature.
- Decides which tiles at each zoom level the feature touches.
- Clips the feature to each tile's boundary, with a small buffer to avoid visible seams.
- Encodes the clipped geometry into the MVT protobuf format.
- Optionally applies feature-density-based simplification for higher zoom levels.
The result is a directory of .pbf files (one per tile) organised in the standard {z}/{x}/{y} structure that web map renderers expect.
Tile Pyramid Structure
Web maps use a tile pyramid: zoom 0 is one tile covering the whole world; zoom 1 is four tiles; zoom 2 is sixteen; and so on. By zoom 14, the world is divided into 268 million tiles. The packager generates tiles only for the zoom range you specify and only for the area covered by your data.
Generalisation by Zoom
A fundamental MVT trick is that lower zoom levels show simplified geometry. A country boundary at zoom 0 doesn't need every coastal vertex; the packager applies the Douglas-Peucker algorithm with a tolerance proportional to the tile size at each zoom level.
Layer Encoding
A single MVT tile can hold multiple named layers (e.g., roads, buildings, water). The packager treats the input GeoJSON as one layer by default but can split features into multiple layers based on a property.
Practical Applications
Web Map Performance Testing
Developers building Mapbox GL or MapLibre maps need test data in MVT format to validate their styles. The packager produces tile sets locally for offline testing.
Self-Hosted Map Tile Servers
Operators running their own tile servers (Tegola, Martin, pg_tileserv, OpenMapTiles) can pre-generate tiles from a GeoJSON dataset and serve them statically.
Embedded Maps in Static Sites
A blog post or article that needs an interactive map can ship the MVT tiles alongside the HTML, no backend required.
Mobile Offline Maps
Mobile mapping apps that work offline need bundled tile sets. MVT is the most efficient vector format for the use case.
Style Development
Cartographers iterating on Mapbox style JSON need a known dataset to develop against. Generating MVT from a sample GeoJSON gives them that.
Educational Demos
Instructors teaching web cartography concepts use the packager to demonstrate how vector tiles differ from raster tiles and from full GeoJSON.
Bandwidth-Constrained Deployments
NGOs deploying maps in low-bandwidth regions benefit from MVT's compactness and efficient on-demand loading.
Step-by-Step Workflow in gis.tools
- Open the Vector Tile Packager page.
- Drag a
.geojsonfile into the drop zone. - Set the minimum and maximum zoom levels (typical: 0β14).
- Optionally configure the layer name and any property-based layer splitting.
- Click Generate Tiles β the packager produces a downloadable archive of
.pbffiles. - Preview the result on the built-in tile viewer to verify rendering.
- Download the archive and serve from a web server, CDN, or static hosting.
Worked Example
A cartographer is building a custom map of public art installations across a city. Her GeoJSON has 1,200 point features. She drops it into the packager, sets the zoom range to 10β16 (city to street level), names the layer art_pieces, and generates the tiles. The output is a 480 KB archive containing 314 tiles. She uploads the tiles to her static site host, references them from a MapLibre GL style as https://example.com/tiles/{z}/{x}/{y}.pbf, and the map loads smoothly on every device.
Common Pitfalls and Gotchas
- Over-tiling at high zooms β Generating tiles up to zoom 18 for a continent-scale dataset produces millions of tiles, most of them empty.
- Wrong CRS β MVT assumes Web Mercator (EPSG:3857). Reproject before packaging.
- Feature simplification artefacts β Aggressive simplification at low zooms can produce sliver gaps.
- Property name collisions β Mapbox style spec is case-sensitive; mismatched property names break the styling.
- Antimeridian crossing β Features that cross 180Β° longitude need special handling.
- Empty tiles β Areas with no data still generate empty tile entries; the packager can skip these to save space.
- Buffer size β Too small a buffer creates visible seams; too large wastes bytes.
Tips for Best Results
- Choose a zoom range that matches your data's scale β don't generate zoom 18 tiles for country boundaries.
- Validate the GeoJSON with the GeoJSON Validator & Fixer before packaging.
- Use the GeoJSON Simplifier for additional control at low zooms.
- For multi-layer maps, prepare your GeoJSON with a layer property and use property-based splitting.
- Reduce file size further with the Coordinate Precision Reducer.
- Verify the output with the PMTiles/MBTiles Inspector if you're packaging into a single file.
- Test on real network conditions to confirm load performance.
Comparison with Other GIS Approaches
Mapbox's tippecanoe is the industry-standard CLI tool for generating MVT, with a vast feature set. PostGIS has ST_AsMVT for serving tiles directly from a database. Tegola and Martin are server-side tile generators. The browser-based gis.tools packager is the simplest option for one-off tile generation without installing a tippecanoe binary or running a database.
Performance Considerations
Tile generation is CPU-intensive but parallelisable. The browser handles up to a few hundred megabytes of GeoJSON before slowing down. For very large datasets, use tippecanoe on the command line.
Data Privacy and Browser-Based Processing
The entire packaging operation runs in your browser tab. No data is uploaded; no telemetry is collected. The generated tiles are downloaded directly to your machine.
Related GIS Concepts
MVT Specification β The Mapbox-defined protobuf schema for vector tiles, now widely adopted.
Tippecanoe β Mapbox's reference implementation of GeoJSON-to-MVT conversion.
PMTiles β A single-file alternative to directories of .pbf tiles, with HTTP range request support.
MBTiles β An older single-file SQLite-based tile container, common in offline mobile maps.
Frequently Asked Questions
What's the difference between MVT and PMTiles?
MVT is the tile format. PMTiles is a single-file container that stores MVT tiles plus metadata. The PMTiles/MBTiles Inspector handles the container side.
Can I use the tiles with Leaflet?
Leaflet doesn't natively render MVT, but plugins like Leaflet.VectorGrid can.
What zoom range should I use?
Match your data's scale: 0β6 for global, 6β10 for country, 10β14 for city, 14β18 for street level.
Can I generate raster tiles from GeoJSON?
Not with this tool β it produces vector tiles. For raster tiles from raster data, see the GeoTIFF Tiles Preview.
Related Tools on gis.tools
Related Tools
View All ToolsGeoJSON to TopoJSON Converter
Convert between TopoJSON and GeoJSON with topology preservation
Import & ExportGeoTIFF Tiles Preview
Preview GeoTIFF as PNG tiles with client-side tiling
Import & ExportWKT Viewer & WKB Converter
View and convert Well-Known Text (WKT) and Well-Known Binary (WKB) geometries
Import & ExportCSV to Points Layer
Build a points layer from CSV with latitude/longitude columns
Import & ExportLayer Packaging Tool
Package selected layers with style JSON into a downloadable ZIP
Import & ExportGeoJSON Validator & Fixer
Validate GeoJSON and fix common issues like ring winding and invalid coordinates
Import & Export100% client-side processing - your data stays private and never leaves your device