What is the SHP file format?
The .shp file format (short for *shape*) is used for storing vector geometry and data related to geospatial information used by geographic information system (GIS) software. An .shp file can hold geographical and spatial data that describes such entities as landmarks, rivers, streets, or postal zones.
The format was created by Esri, a company that supplies GIS software products including ArcGIS, and is still actively developed. The technical specification was published by Esri in 1998 and is publicly available, though the format itself remains proprietary rather than a fully open standard.
Geometry model
An .shp file represents geometry as a 2D or 3D dataset built from points, lines, and polygons. Each element of the dataset can carry attributes - stored in a companion .DBF file - that describe properties of the related features. The file begins with a fixed 100-byte header whose first four bytes hold the file code 9994 in big-endian order.
Companion files
.shp files are always accompanied by additional files, some required and some optional. Required files: .shp, .SHX (spatial index), and .dbf (attribute table) - all must be located in the same folder. Optional files include .PRJ (coordinate reference system), .sbx/.sbn (spatial index caches), and .xml (metadata).
Security & safety
RISK: LOWA Shapefile is passive data with no executable content, so it is safe to open. The practical 'problem' is missing siblings: a lone .shp without its .dbf and .shx will fail to open or show no attributes - always keep the whole set (and .prj) together, which is why Shapefiles are shipped zipped. Very large Shapefiles have hard limits (2 GB per file, and .dbf field-name length/encoding quirks) that can truncate data - for big or modern datasets prefer GeoPackage. Treat zipped Shapefiles from unknown sources with normal archive caution.
Format details
in a nutshell- AutoCAD/3ds Max shape definition - A plain-text shape/font definition used in AutoCAD and 3ds Max, unrelated to GIS data and opened in those CAD programs.
Programs that open SHP files
Technical details
deep spec| Magic bytes | 00 00 27 0A at offset 0 (big-endian integer 9994) |
| Byte order | Mixed: header fields stored big-endian; geometry record content stored little-endian |
| File header size | Fixed 100-byte header in both .shp and .shx files |
| MIME type | application/x-esri-shape |
| Supported shape types | 15 defined types with non-contiguous codes (0-31): Null, Point, Polyline, Polygon, MultiPoint, and their M, Z, and 3D variants, plus MultiPatch |
| Shape type per file | A single .shp file stores only one shape type - all geometry records share the same type code |
| Coordinate dimensions | 2D (X,Y), measured 2.5D (X,Y,M), and true 3D (X,Y,Z,M) |
| Coordinate precision | IEEE 754 double-precision (64-bit) floating-point for all coordinates |
| Attribute storage | dBASE III .dbf companion file; field names capped at 10 characters; text values at 254 characters per field |
| Spatial index (.shx) | Fixed-length 8-byte records per shape (4-byte offset + 4-byte content length) enabling O(1) record lookup |
| Maximum file size | Both .shp and .shx are limited to 2 GB; the 32-bit file-length field counts 16-bit words |
| Coordinate reference system | Stored in an optional .prj file as OGC Well-Known Text (WKT); an absent .prj means CRS is undefined |
| Polygon ring convention | Outer rings wound clockwise; interior (hole) rings wound counter-clockwise - opposite to GeoJSON convention |
| Text encoding | No built-in Unicode; .dbf uses a single-byte code page; a companion .cpg file can declare the encoding explicitly |
| Released | 1998 (Esri published the Shapefile technical description; format in use from the early 1990s ArcView era) |
| Open standard | Yes · royalty-free |
| Specification | www.esri.com |
SHP conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about SHP files.