Ask a GIS professional what a shapefile is and watch them smile: it is the format everyone uses, everyone complains about, and nobody can quite kill. Esri introduced it in the early 1990s, published the specification, and it became the lingua franca of geographic data. Its defining quirk is in the name's lie: a "shapefile" is at minimum three files, usually four or more, sharing one base name. The explorer below shows the coordinate side of the data shapefiles carry; this guide covers the container itself, piece by piece, limit by limit.
Home / GIS and Open Map Data for Beginners
What Is a Shapefile? The Four Files, the Famous Limits, and When to Retire It

Photo: Miguel González / Pexels
Coordinate Explorer: X First, Then Y
Click a place and read the pair it reports. A shapefile stores its geometry as number pairs in exactly this order, eastings before northings, in whatever coordinate system its .prj file declares.
Map data © OpenStreetMap contributors. Coordinates are read from the map itself, in the WGS 84 system your phone uses.
The Component Files
| Extension | Job | What breaks without it |
|---|---|---|
| .shp | The geometry: points, lines, polygons | No shapes at all; the dataset is gone |
| .shx | The index into the .shp | Most software cannot read the geometry |
| .dbf | The attribute table, in dBASE format | Shapes with no data attached |
| .prj | The coordinate reference system definition | Shapes that appear in the wrong place on Earth |
| .cpg | The text encoding of the .dbf | Attribute text garbled in other languages |
| .sbn, .sbx | Spatial indexes, created by software | Nothing permanent; they regenerate |
The first three are the mandatory core: geometry, index, attributes. The .prj is technically optional and practically essential: it is a small text file stating which coordinate system the numbers speak. Without it, software must guess or ask, and a guessed wrong answer places your data in the wrong ocean with total confidence, the file level version of the notation traps in our coordinate notation guide. The whole family travels together or not at all, which is why shapefiles are shared as zip archives: the zip is not compression politeness, it is structural necessity. Send someone only the .shp, the mistake every beginner makes exactly once, and you have sent them a broken dataset.
One Geometry Type, One Dataset
A shapefile holds exactly one kind of geometry: points, or lines, or polygons, never a mixture, and a related rule bars mixing subtypes like single and multi part features in some workflows. A city's data therefore arrives as a shelf of shapefiles: buildings here, roads there, parcels in a third. Coordinates inside are stored as x, y pairs in the file's declared system, in the eastings before northings order the notation guide describes. Z values and measures exist in optional variants. Nothing in the format stores topology, so two polygons that share a border each carry their own copy of it, which is why shapefile borders can develop slivers when edited carelessly.
The Famous Limits
The format's age shows in its ceilings, and every working analyst has hit at least one. 2 GB per component file: when a .shp or .dbf crosses that line, the dataset must split. Field names capped at 10 characters: the dBASE inheritance, which is why attribute tables everywhere speak in abbreviations like POP_2020 and ROAD_TYPE_, truncated whether you like it or not. 255 fields maximum per table. No true null values in many field types, so missing numbers become zeros and missing dates become ancient defaults, a quiet source of analytical lies. No time component in its date fields. Text encoding ambiguity that the .cpg file patches after the fact. None of these were flaws in 1992; all of them are friction now, and together they explain the successors.

The Successors, and When to Switch
GeoPackage is the heir apparent: a single file, an open OGC standard, multiple layers and geometry types inside, no 10 character limit, real nulls, and native support in QGIS as its default. GeoJSON owns the web side, human readable and API native, at the cost of size and precision habits discussed in our GeoJSON vs shapefile comparison. The rule for switching is simple: keep receiving shapefiles forever, because the world sends them; start new work in GeoPackage, and publish to the web in GeoJSON. In QGIS, the conversion is a right click export, which is how most shapefiles quietly retire. Beginners meeting the format for the first time should pair this guide with GIS for beginners, and builders pulling open data will meet shapefiles throughout the sources in open map data.
A Short History of an Unkillable Format
Esri published the shapefile specification in the 1990s, building on the dBASE table format from the decade before, and gave the spec away. That openness, plus ArcView's dominance, made it the default exchange format of a young industry: governments published in it, consultants delivered in it, and every GIS since has been required to read it. Its limits are the era's limits: dBASE's field name rules, 32 bit file offsets behind the 2 GB ceiling, no standard encoding in a pre Unicode workflow. The format has outlived the software that created it, the company strategies around it, and several anointed successors, because data outlives tools and the world's archives are written in it. Billions of shapefiles sit in agency downloads and project folders, which is why this guide treats reading one as a permanent literacy rather than a legacy chore, and why our GeoJSON vs shapefile comparison frames the choice as archive versus web, not old versus new.
Working Habits That Prevent the Classic Accidents
Zip the family, always. Sharing, archiving, and backing up all treat the component set as one object; a zip named for the dataset is the unit of exchange. Never rename one component. The shared base name is the glue; renaming the .dbf alone orphans the attributes silently. Declare the .prj before analysis. A dataset opened without its coordinate system stated is a rumor; set it in the GIS first, and if the .prj is missing, identify the system from the source's documentation rather than guessing, because a wrong guess is worse than an honest unknown. Watch the field names on export. Moving from a modern format into shapefile truncates names at 10 characters and can collide two long names into one; check the exported table before the analysis, not after. Mind the zeros that mean missing. Exports into .dbf turn nulls into zeros in numeric fields; a mean elevation or population computed over those zeros is a lie with decimal places. These five habits, plus converting working copies to GeoPackage on arrival, are the difference between the format as a reliable archive and the format as a recurring incident. The conversion itself is a right click in QGIS, and the beginners' path through all of it starts at GIS for beginners.
Anatomy of a Real Dataset: Reading One Cold
Take a shapefile you have never seen, a download named something like districts.zip, and read it like a professional. Unzip and inventory the family: the mandatory trio present, a .prj riding along, a .cpg if the source cares about text. Open the .prj in a text editor and name the coordinate system out loud; that act alone prevents the commonest disaster in the format's life. Open the attribute table before the map: count the fields, note the 10 character names and decode their abbreviations from the source's documentation, and scan for the zeros that mean missing. Check the geometry type by what the software reports, and the feature count against the source's claim. Only then draw it, and draw it over a basemap, because a dataset that lands in the wrong place announces itself instantly against known geography while a table never will. Five minutes of this cold reading, and the shapefile has told you its system, its contents, its era, and its likely lies. It is the same evidentiary habit this site applies to open map data of every format, because containers change and skepticism should not.
Related Guides
If this page answered part of the question, these GIS and open map data guides cover the rest of the same ground:
- GeoJSON to Shapefile: QGIS, ogr2ogr, and GeoPandas Routes, and the Four Things That Break on the Way: Converting GeoJSON to shapefile takes one command or four clicks, and the conversion is the easy part.
- Shapefile vs Geodatabase: The Limits That Decide Which Container Your Data Deserves: The shapefile is a 1990s format that still runs the world's data exchanges, and the file geodatabase is Esri's modern container that removes...
- How to Learn GIS: A Four Stage Self Study Plan With an Artifact at Every Stage: Most GIS learning advice is a resource dump: forty links, three platforms, no order, and no way to know when you have actually learned anything.
- QGIS Open GDB: Read a File Geodatabase With the OpenFileGDB Driver: The geodatabase counterpart to this format, opened in QGIS without Esri software.
- Shapefile Viewer: Open a Shapefile Without Desktop GIS: The viewing surface as its own skill, including the missing-.prj trap.
Frequently Asked Questions
Why is a shapefile made of several files?
Because its design separates the jobs: .shp stores geometry, .shx indexes it, .dbf holds the attribute table, and .prj declares the coordinate system. The split dates to early 1990s software design. All components share one base name and must stay together; sharing a shapefile means zipping the whole family.
What happens if the .prj file is missing?
The geometry survives but its meaning is unstated: the software does not know which coordinate system the numbers use, so it guesses, asks, or places the data wrongly. A dataset that appears in the wrong ocean with no error message is usually a missing or wrong .prj. Recreate it by declaring the correct system in your GIS; the numbers themselves are unharmed.
What are the size and field limits of a shapefile?
Each component file caps at 2 GB. Attribute field names cap at 10 characters, with a maximum of 255 fields. The format also lacks true null values for many types and stores dates without times. These dBASE era limits are the main reason modern work moves to GeoPackage.
Can a shapefile contain points and polygons together?
No. One shapefile holds one geometry type only: points, lines, or polygons. A project with all three is at least three shapefiles. Formats like GeoPackage remove this rule and hold mixed layers in a single file.
Should I still use shapefiles in new projects?
Receive them, yes; start new work in them, no. Shapefiles remain the exchange format much of the world sends, so reading them is a permanent skill. For your own datasets, GeoPackage gives you one file, no 10 character field names, and modern data types, and QGIS converts between them in seconds.
How do I open a shapefile without GIS software?
Online shapefile viewers can draw one in a browser for a quick look, and spreadsheet style tools can read the .dbf table alone, which answers attribute questions without any map. For real work, the free QGIS opens the whole family natively; our QGIS tutorial for beginners gets a first dataset on screen in minutes.
Photo credits: Miguel González (Pexels); Juan Carlos Meléndez (Pexels). Photos are served from this site; follow the credit to the library page for the original.