GeoDataViewer
Menu
Launch Studio
Theme
GeoDataViewer Team Updated:

What Is an OSM PBF File? OpenStreetMap Binary Format Explained

Learn what an OSM PBF file is, how it compares with OSM XML and GeoJSON, when to use regional extracts, and how to open or convert PBF data online.

An OSM PBF file is a compact binary extract of OpenStreetMap data. The .osm.pbf extension stands for OpenStreetMap Protocolbuffer Binary Format. It stores OSM nodes, ways, relations, tags, and metadata in compressed protocol-buffer blocks rather than as human-readable XML.

Quick answer: use OSM PBF when you need a compact regional or planet-scale OpenStreetMap extract for data processing. For a quick browser preview, open a manageable file in the online OSM PBF viewer. For one feature type or a small custom area, an Overpass GeoJSON export is usually a better starting point.

The OpenStreetMap PBF format reference describes PBF as an alternative to the original XML representation, with independently decodable file blocks designed for efficient processing.

What does an .osm.pbf file contain?

An OSM PBF extract can contain the core OpenStreetMap primitives:

  • Nodes — point locations with coordinates and optional tags
  • Ways — ordered node references used for roads, paths, building outlines, and other line or area features
  • Relations — groups of nodes, ways, or other relations used for multipolygon boundaries, routes, and complex features
  • Tags — key/value attributes such as highway=residential or building=yes
  • Metadata — depending on the extract and processing options, this can include IDs, timestamps, users, and version information

PBF is not the same as a ready-made GeoJSON layer. It is an OSM data container whose entities may need filtering, feature assembly, projection handling, and conversion before they become a focused GIS layer.

OSM PBF vs OSM XML vs GeoJSON

FormatBest forMain trade-off
OSM PBFCompact regional or planet extracts and data processingBinary and less convenient to inspect manually
OSM XMLInterchange, debugging, and workflows that need readable source textLarger files and slower processing at scale
GeoJSONFocused web-map layers and application APIsVerbose for large datasets and not a complete replacement for raw OSM primitives

PBF is generally the practical choice for a large OSM extract. GeoJSON is often better after you have selected a theme or area and want to work with a browser map, an API, or a conventional GIS layer.

Regional extract or planet file?

The size of an OSM PBF file determines the right workflow:

  • City or small region: useful for local inspection, experiments, and browser-based previews
  • Country or continent: better suited to desktop GIS, command-line extractors, or a server-side processing pipeline
  • Planet file: intended for specialized data infrastructure and batch processing; it is not a practical first upload for a browser viewer

For regional data, start with the OSM download directory and choose an extract that matches the area you need. If you only need buildings, waterways, airports, or another feature class, use a focused query instead of downloading every OSM primitive.

Geofabrik or Overpass: which should you use?

Use a regional Geofabrik OSM extract when you need broad coverage and many feature types. Use Overpass Turbo when you need a smaller, topic-specific result for a city or custom bounding box.

Overpass can export GeoJSON, KML, or GPX for a focused result. That output is often easier to open in a web map than a raw PBF because it has already been filtered for the task.

How to open an OSM PBF file online

  1. Open the free OSM PBF viewer.
  2. Choose a small or medium .osm.pbf extract.
  3. Inspect the map and available feature information in your browser.
  4. If the file is too large or you need a single theme, create a smaller extract with Overpass or an OSM processing tool first.

GeoDataViewer processes supported files locally in the browser. A browser preview is useful for a quick look; it does not replace a full OSM extraction pipeline for planet-scale data.

Converting PBF data for GIS workflows

The useful destination depends on what you need to do next:

  • Convert a focused result to GeoJSON for web maps and APIs.
  • Use Shapefile or GeoPackage when a desktop GIS workflow requires those outputs.
  • Keep PBF when you need the OSM primitives and tags for another processing tool.

The OSM PBF tools hub brings together the viewer, download sources, and extraction workflow. Do not convert a full planet file in the browser unless the file size and available memory are appropriate for the task.

Frequently Asked Questions

What is PBF in OpenStreetMap?

PBF is the compact Protocolbuffer Binary Format used for many OpenStreetMap data extracts. It is designed to store OSM primitives more efficiently than XML while retaining the entities and tags needed for processing.

Can I open an OSM PBF file in a browser?

Yes, a manageable extract can be previewed in the OSM PBF viewer. Very large country, continent, or planet files may require a dedicated OSM processing tool instead of a browser preview.

Is PBF better than GeoJSON?

Neither format is universally better. PBF is more suitable for compact raw OSM extracts and processing pipelines; GeoJSON is usually more convenient for a focused layer in a web map or API.

How do I convert OSM PBF to GeoJSON?

For a small topic-specific result, run an Overpass query and export GeoJSON. For larger extracts, filter and convert the PBF with an OSM-aware processing tool before opening the resulting GeoJSON in a browser viewer.

Is .pbf the same as .osm.pbf?

The .osm.pbf extension identifies an OpenStreetMap PBF extract. Other software may use .pbf for unrelated protocol-buffer or GIS data, so the filename and source should be checked before choosing a parser.

Share this post:
G
GeoDataViewer Team
The GeoDataViewer team builds tools for GIS professionals who need quick, private, browser-based access to geospatial data. We write about formats, conversion workflows, and practical GIS techniques based on years of experience with QGIS, ArcGIS, GDAL, and web mapping libraries.