What is the OSM file format?
.osm (short for OpenStreetMap) is a file format used by OpenStreetMap editors and GIS software. .osm files contain geographic map data and can store information for areas of any size - from small neighborhoods to global street networks.
.osm files store data in XML format (UTF-8 encoded, MIME type application/vnd.openstreetmap.data+xml). Each file opens with an XML declaration followed by an <osm version="0.6"> root element. Because raw .osm files can grow very large, they are frequently distributed in compressed form as .osm.bz2 or .osm.gz.
.osm files store geographic data in a structured manner using three primitive element types. <node> elements represent point locations with WGS84 latitude and longitude coordinates. <way> elements are ordered sequences of node references forming roads, waterways, and building outlines. <relation> elements group nodes, ways, and other relations to model complex structures such as turn restrictions or administrative boundaries. Each element carries <tag k="..." v="..."/> key-value pairs describing its real-world properties.
planet.osm is the complete OpenStreetMap database export, which can be accessed and modified by any registered user. Users can add new features or edit those already included. The uncompressed planet file exceeds 2 TB, so most users download regional extracts or prefer the compact binary .pbf format. Incremental map updates are distributed as .osc OsmChange files.
Security & safety
RISK: LOWOSM XML is plain text with no executable content, so opening it is harmless. The only practical caution: very large extracts (region/planet) can exhaust memory in editors and text viewers - use the .osm.pbf binary and tools like osmium for big data. The data is openly licensed (ODbL); reusing it requires attribution to OpenStreetMap contributors.
Format details
in a nutshell- Osmand / OruxMaps offline map data - Apps render maps from OSM-derived data, but their packaged map files use other extensions (.obf, .map), not .osm.
Programs that open OSM files
Technical details
deep spec| File encoding | UTF-8 plain text (XML) |
| MIME type | application/vnd.openstreetmap.data+xml |
| Root element | <osm> carrying version="0.6", a generator attribute and an optional <bounds> child |
| Primitive element types | Three: <node> (lat/lon point), <way> (ordered node-reference list), <relation> (grouped elements) |
| Coordinate system | WGS84 geographic coordinates; latitude and longitude stored as decimal degrees with up to 7 decimal places (nanodegree precision) |
| Tag system | Unlimited <tag k="..." v="..."/> key-value pairs per element; keys and values are free-form UTF-8 strings with no enforced vocabulary |
| Per-element metadata | Each element stores id (64-bit integer), version number, changeset ID, timestamp, uid and user attributes tracking edit history |
| Typical file size | A few KB for a single-object export; many GB for a country extract; planet.osm raw XML exceeds 2 TB uncompressed |
| File identification | No binary magic bytes; identified by XML declaration followed by an <osm> root containing <node>, <way> or <relation> children |
| Compression | None in raw .osm; routinely compressed to .osm.bz2 or .osm.gz for distribution; binary sibling .osm.pbf uses Protocol Buffers + zlib |
| Data integrity | No built-in checksum; integrity relies on well-formed XML and globally unique element id/version pairs |
| API schema version | OSM data model API v0.6, introduced 2009 and still current; declared via version="0.6" on the <osm> root element |
| Incremental update format | Map edits are exchanged as .osc (OsmChange) files, not plain .osm; .osc wraps the same primitives inside <create>, <modify> and <delete> blocks |
| Element ID size | 64-bit signed integers, permitting billions of unique node, way and relation IDs in the global database |
| Spatial bounding box | Optional <bounds minlat="..." minlon="..." maxlat="..." maxlon="..."/> element declares the geographic extent of the extract |
| Released | 2005 (OSM XML API v0.3 era); current OSM data model API v0.6 since 2009 |
| Latest version | OSM XML schema tied to API v0.6 (2009, still current in 2026) |
| Open standard | Yes · royalty-free |
| Specification | wiki.openstreetmap.org |
OSM conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about OSM files.