# OSM — OpenStreetMap PBF (Protocolbuffer Binary Format)

> OSM (OpenStreetMap PBF (Protocolbuffer Binary Format)): Compact binary format based on Protocol Buffers for storing OpenStreetMap nodes, ways, relations and tags. Specs, software and free sample files; convert OSM to 40 formats online.

- Page: https://beta.mygeodata.cloud/formats/osm



## What is a OSM file?

OSM PBF is the binary encoding of OpenStreetMap data, defined by the OpenStreetMap project as an alternative to the OSM XML format. The full planet file and many regional extracts are distributed in it. Files are much smaller than uncompressed XML and considerably faster to read and write.

The file is a sequence of blocks encoded with Google Protocol Buffers and typically compressed with zlib. Each block holds OSM primitives: nodes with coordinates, ways as ordered node references, and relations grouping other elements. Free-form key-value tags describe all of them. Coordinates are WGS 84 longitude and latitude stored as integers with a defined granularity, and delta coding keeps node data compact. The format contains no ready-made GIS geometries. Software such as osm2pgsql or GDAL/OGR assembles ways and relations into points, lines and multipolygons on import, and polygon detection depends on tagging rules and relation completeness.

OSM PBF files are mostly received from public extract providers or exported from OpenStreetMap tools, often as a country or region download. Because the file stores raw nodes, ways and relations rather than finished GIS features, results depend on the importing software. Check that the extract is complete, since ways cut at the boundary may lose nodes or relation members and affect polygons.

### Technical details

| | |
|---|---|
| Full name | OpenStreetMap PBF (Protocolbuffer Binary Format) |
| Data type | Vector · GIS vector |
| File extension | .osm.pbf, .osm, .pbf |
| Files | Single file |
| Media type | application/octet-stream |
| Geometry types | Point, LineString, Polygon |
| Multiple layers | Yes |
| Mixed geometry in a layer | No |
| Attribute names | — |
| Coordinate system | Always WGS 84 (EPSG:4326) |
| Converter support | Read only |
| Typical software | Osmium, osm2pgsql, Osmosis, imposm, GDAL/OGR, QGIS |
| Specification | https://wiki.openstreetmap.org/wiki/PBF_Format |

### Specifications & references

- https://wiki.openstreetmap.org/wiki/PBF_Format
- https://gdal.org/en/stable/drivers/vector/osm.html

### Sample OSM files — free download

- [Saint Helena (complete OSM extract)](https://beta.mygeodata.cloud/static/landing/samples/v1/osm_pbf/st-helena.osm.pbf) — All OpenStreetMap nodes, ways and relations of the island of Saint Helena (osmium extract of the Geofabrik file). (395 kB, EPSG:4326)
- [Jamestown (OSM extract)](https://beta.mygeodata.cloud/static/landing/samples/v1/osm_pbf/jamestown.osm.pbf) — OpenStreetMap data of the capital Jamestown and its valley (bbox extract). (47.7 kB, EPSG:4326)
- [Jamestown (OSM XML)](https://beta.mygeodata.cloud/static/landing/samples/v1/osm_pbf/jamestown.osm) — The same Jamestown extract as plain OSM XML (.osm). (744.5 kB, EPSG:4326)

### Convert OSM to other formats

- [OSM to DXF](https://beta.mygeodata.cloud/converter/osm-to-dxf)
- [OSM to SHP](https://beta.mygeodata.cloud/converter/osm-to-shp)
- [OSM to SVG](https://beta.mygeodata.cloud/converter/osm-to-svg)
- [OSM to GeoPDF](https://beta.mygeodata.cloud/converter/osm-to-geopdf)
- [OSM to GeoJSON](https://beta.mygeodata.cloud/converter/osm-to-geojson)
- [OSM to KML](https://beta.mygeodata.cloud/converter/osm-to-kml)
- [OSM to GPX](https://beta.mygeodata.cloud/converter/osm-to-gpx)
- [OSM to GPKG](https://beta.mygeodata.cloud/converter/osm-to-gpkg)
- [OSM to CSV](https://beta.mygeodata.cloud/converter/osm-to-csv)
- [OSM to KMZ](https://beta.mygeodata.cloud/converter/osm-to-kmz)
- [OSM to XLSX](https://beta.mygeodata.cloud/converter/osm-to-xlsx)
- [OSM to MapInfo](https://beta.mygeodata.cloud/converter/osm-to-mapinfo)
- [OSM to TopoJSON](https://beta.mygeodata.cloud/converter/osm-to-topojson)
- [OSM to GML](https://beta.mygeodata.cloud/converter/osm-to-gml)
- [OSM to SQLite](https://beta.mygeodata.cloud/converter/osm-to-sqlite)
- [OSM to MIF](https://beta.mygeodata.cloud/converter/osm-to-mif)
- [OSM to DGN](https://beta.mygeodata.cloud/converter/osm-to-dgn)
- [OSM to Parquet](https://beta.mygeodata.cloud/converter/osm-to-parquet)

## Frequently asked questions

### Why do I see only points, or no polygons, after opening a PBF file?

The file holds nodes, ways and relations, not ready geometries. GDAL/OGR exposes separate layers for points, lines, multilinestrings, multipolygons and other relations, so choose the layer you need. Areas appear as polygons only when tagging and relation members allow it.

### What is the difference between OSM PBF and OSM XML?

Both carry the same OpenStreetMap data model of nodes, ways, relations and tags. PBF is a compressed binary encoding, so it is much smaller and faster to read, while XML is human-readable text but large. PBF cannot be edited in a text editor.

### Can I write or edit a PBF file in GIS software?

GDAL/OGR and QGIS read PBF but do not write it here. To change OSM data, use dedicated tools such as Osmium or Osmosis, or convert the data to another format, edit it there, and keep the original PBF as the source.

### What is a OSM file?

OSM PBF is the binary encoding of OpenStreetMap data, defined by the OpenStreetMap project as an alternative to the OSM XML format. The full planet file and many regional extracts are distributed in it. Files are much smaller than uncompressed XML and considerably faster to read and write.

The file is a sequence of blocks encoded with Google Protocol Buffers and typically compressed with zlib. Each block holds OSM primitives: nodes with coordinates, ways as ordered node references, and relations grouping other elements. Free-form key-value tags describe all of them. Coordinates are WGS 84 longitude and latitude stored as integers with a defined granularity, and delta coding keeps node data compact. The format contains no ready-made GIS geometries. Software such as osm2pgsql or GDAL/OGR assembles ways and relations into points, lines and multipolygons on import, and polygon detection depends on tagging rules and relation completeness.

### How do I open a OSM file?

OSM files can be opened in Osmium, osm2pgsql, Osmosis, imposm and GDAL/OGR. Without any software you can preview and convert them online in MyGeodata Cloud.

### What can I convert OSM to?

Popular conversions are DXF, SHP, SVG, GeoPDF, GeoJSON and KML. In total the Converter writes OSM data to 40 formats.

### Which coordinate system does OSM use?

OSM always uses WGS 84 (EPSG:4326).

