Convert PBF to CSV
What converting a PBF file to CSV actually changes, what you lose, and how to keep the result readable and usable in spreadsheets and other tools.
Turning a PBF file into CSV sounds like a simple format swap, but it is closer to a translation. PBF stores structured, compressed binary data. CSV is a flat, human-readable table. This review explains what the conversion changes, when it is worth doing, and what to check so the output stays readable and usable after you open, copy or share it.
Is converting PBF to CSV suitable for your use?
Converting is a good fit when you need a slice of the data in table form: a list of points of interest with names and coordinates, a tag inventory, or a dataset to filter and count in a spreadsheet or a data analysis library. The main benefit is accessibility. Almost any tool can open CSV, and no special software is needed to inspect it.
The decisive tradeoff is structure. A PBF file usually holds linked, nested data, and CSV cannot represent those links natively. You must decide which records, which attributes and which geometry representation to keep, and everything else is dropped or flattened. If you need routing, editing, topology, or accurate shapes of roads and buildings, CSV is the wrong target. A spatial format such as GeoJSON or GeoPackage, or keeping the original PBF, is the better choice.
A bounded recommendation: convert to CSV when your question is tabular and you can name the columns you need in advance. Keep the PBF, or use a geometry-aware format, when the relationships between features matter.
First, which PBF do you have?
PBF stands for Protocolbuffer Binary Format, and the extension is used for more than one kind of file. The right conversion path depends on which one you have.
- OpenStreetMap extracts, usually named with .osm.pbf: the most common reason people search for this conversion. They contain map data as nodes, ways and relations, each with free-form key-value tags.
- Vector map tiles saved as .pbf: these encode features for one tile, with coordinates in a tile-local grid rather than latitude and longitude. Decoding them to CSV requires knowing the tile position and converting coordinates.
- Other Protocol Buffers data: generic serialized messages that cannot be decoded meaningfully without the matching schema definition.
The rest of this article focuses on OpenStreetMap PBF, since that is what most readers mean. The same principles about flattening and CSV handling apply to the other cases.
What the conversion actually changes
This is not a text transformation in the sense of reversing, mirroring or restyling characters. The words and names inside the data are not altered by a correct conversion. What changes is the container and the structure around those values.
- Encoding: compressed binary blocks become uncompressed plain text, so the file is typically much larger than the source.
- Structure: nodes carry coordinates, ways reference lists of node IDs, and relations group other elements. CSV has one row per record and fixed columns, so these references must be resolved into a geometry value or discarded.
- Attributes: OpenStreetMap tags are open-ended, so different features have different keys. A CSV needs a fixed set of columns, so you either pick specific keys, or pack the remaining tags into a single text column.
- Geometry: points can become separate latitude and longitude columns. Lines and polygons are commonly written as a text representation such as WKT in one column, which is machine-readable but not easy for people to read.
Two ideas are worth keeping apart. Stored characters are the actual values written into the CSV, for example a street name in Arabic script. Visual presentation is how a spreadsheet or editor displays them, for example showing right-to-left text in the expected direction. A conversion should preserve the stored characters exactly; display behavior is up to the application that opens the file and does not change the data.
Common ways to do the conversion
Local command-line tools are the usual route for OpenStreetMap PBF. GDAL's ogr2ogr can read OSM PBF through its OSM driver, which exposes the data as layers such as points, lines, multilinestrings, multipolygons and other_relations, and it can write CSV. osmconvert also offers a CSV output mode where you list the fields to export. The command below is illustrative of the GDAL approach; options vary by version, so confirm them against the documentation for your installed release.
ogr2ogr -f CSV points.csv input.osm.pbf points -lco GEOMETRY=AS_WKT
Scripting libraries for OpenStreetMap data are another option when you need custom rules for which tags become columns. Online converters exist as well. Their appearance or wording does not tell you how they handle uploaded files, so check any stated data handling policy before uploading files that are private or not yours to share. Local tools avoid that question entirely.
Evidence gap: no specific tool was tested for this review, so there are no measured speeds, file sizes or accuracy results here. Treat tool choice as something to verify on a small extract first.
Will the CSV stay readable and usable after opening or sharing?
CSV is plain text, which makes it easy to copy and share, but several practical issues can quietly damage the data when it is opened in a spreadsheet or passed between systems.
| Issue | What can go wrong | What to do |
| Character encoding | OpenStreetMap names use many scripts; an application that assumes the wrong encoding shows garbled text | Write UTF-8 and choose UTF-8 explicitly when importing |
| Commas, quotes and line breaks in values | Tag values containing delimiters can split into extra columns if not quoted | Make sure the tool quotes fields properly, or use tab-separated output |
| Large numeric IDs | Spreadsheets may reformat long numbers or display them in scientific notation | Import ID columns as text |
| Coordinates | Automatic formatting can round decimal places | Set coordinate columns to a numeric format with enough precision, or keep them as text |
| Row volume | A regional or country extract can exceed what a spreadsheet can load | Filter before converting, or use a database or data analysis tool |
| Geometry strings | Long WKT values are hard to read and can be truncated by some viewers | Keep geometry in its own column and use GIS software to view it |
Reading order and assistive technology: a CSV opened in a spreadsheet is presented as a grid, which screen readers can navigate cell by cell. Short, clearly named columns help. Long geometry strings and packed tag columns are effectively unreadable when spoken aloud, so if the file is meant for people rather than software, provide a simplified version with only the human-relevant columns. No specific screen reader or spreadsheet combination was tested for this review.
Mixed-direction text: names in right-to-left scripts sitting next to numbers or Latin text can appear in a different visual order depending on the application. The stored characters remain in their original order; only the display differs. If text appears jumbled, check it in another editor before assuming the conversion broke it.
Search and editing: plain-text CSV is fully searchable and editable, which is one of its main advantages over binary PBF. Be aware that editing a CSV does not update the source data, and it cannot be loaded back into a PBF without rebuilding the structure that was flattened.
Sharing and licensing: OpenStreetMap data is distributed under the Open Database License, which carries attribution and share-alike obligations. Converting it to CSV does not remove those terms, so include attribution when you publish or share derived files.
Checks before you rely on the output
- Confirm which kind of PBF you have before choosing a tool.
- Test on a small extract and compare a few known features against the source.
- Count rows for the feature types you expected and look for silently dropped categories.
- Open the CSV in a plain text editor as well as a spreadsheet to confirm encoding and quoting.
- Check that names in non-Latin scripts survived intact.
- Keep the original PBF in case you need structure or attributes you did not export.
Bottom line
Converting PBF to CSV preserves the meaning of individual values when done correctly, but it deliberately trades away structure for simplicity. It works well for tabular questions about points and tags. It is a poor fit when shapes, connections or full attribute sets matter, and in those cases a geometry-aware format or the original file serves you better.