.shp

What is a .shp file?

Esri Shapefile · Data · Esri · early 1990s

A .shp file is the geometry part of an Esri shapefile, the long-standing standard for GIS vector data: points, lines and polygons for things like country borders, roads and land parcels.

Category
Data
Type
Binary
Is a .shp file safe to open? Safe. A .shp file is geometry data read by GIS software; it does not execute.

What is a .shp file used for?

A shapefile is really a set of files sharing one name: .shp holds the geometry, .shx the index and .dbf the attribute table, with optional companions like .prj for the projection. Separating any of them breaks the dataset.

The format dates to the early 1990s and its published spec made it the universal exchange format of GIS, despite hard limits (2 GB, field-name lengths, one geometry type per file). Modern work increasingly uses GeoPackage or GeoJSON instead.

What opens a .shp file?

The .shp format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list.

Windows

  • QGIS
  • ArcGIS Pro
  • GDAL/OGR (ogr2ogr)

macOS

  • QGIS
  • GDAL/OGR

Linux

  • QGIS
  • GDAL/OGR

Open a .shp file step by step

  1. Confirm the file really is a .shp. Drop it into the WhatFileType identifier, which reads its signature in your browser without uploading anything.
  2. On Windows, open it with QGIS or ArcGIS Pro.
  3. On Mac, use QGIS or GDAL/OGR.
  4. On Linux, try QGIS or GDAL/OGR.
  5. Still stuck? Convert the .shp to geojson, which opens more widely.

Why can't I open my .shp file?

Almost always because no installed app understands Shapefile. Install one of the apps above, or convert the file to a format your existing software already reads. If double-clicking opens the wrong program instead of nothing at all, the file association is set to the wrong app rather than the file being broken.

The other possibility is that the file is not really a .shp at all. Drop it into the file identifier to check it by its bytes instead of its name. Nothing is uploaded.

How to convert a .shp file

You can convert a .shp file to geojson, kml, csv (attributes) using a conversion tool or the export menu of an app that opens it.

What is the .shp file signature (magic bytes)?

A .shp file starts with the hex bytes 00 00 27 0A. Programs identify Shapefile by those bytes, not by the filename, so a renamed file still gives itself away.

These are the documented signatures for Shapefile. For a full breakdown, see the Shapefile file signature page.

Documented magic-byte signatures for the .shp format
Hex signatureOffsetASCIINote
00 00 27 0A0-file code 9994, big-endian

See the full magic-numbers reference for every format.

Frequently asked questions

What is a .shp file?

A .shp file is the geometry part of an Esri shapefile, the long-standing standard for GIS vector data: points, lines and polygons for things like country borders, roads and land parcels.

How do I open a .shp file?

QGIS (free) or ArcGIS opens it directly; drag the whole fileset in, keeping the .shp, .shx and .dbf files together in one folder.

Why does my shapefile have no attributes or draw in the wrong place?

Missing companions: the .dbf holds the attributes and the .prj the coordinate system. Without them you get bare, possibly misplaced geometry.

How do I convert a shapefile to GeoJSON?

In QGIS export the layer as GeoJSON, or on the command line run ogr2ogr -f GeoJSON out.geojson in.shp with GDAL installed.

Related formats

Sources

Details on this page were checked against authoritative references. How sources are ranked and what is deliberately left out is set out in the methodology.