Convert a file
Home › Guides › What is a shapefile? (and why it's really several files)

What is a shapefile? (and why it's really several files)

You downloaded a shapefile, and it will not open. The usual reason is hiding in the name, because a shapefile is not a single file. It is a small set of files that share one base name and have to travel together. This guide explains what the parts are, how they fit, and where the format's limits start to bite.

Key facts

  • A shapefile is a minimum of 3 files (.shp, .shx, .dbf) and usually 5 with .prj and .cpg, which must travel together.
  • Attribute field names are capped at 10 characters and each file holds a single geometry type.
  • In a 10,000-point test the shapefile was 3.18 MB, of which the .dbf attribute table was 89%.

The parts of a shapefile

Five files do the work, and each one carries a different piece of the layer.

What is a shapefile: the .shp geometry, .dbf attributes, .shx index and .prj coordinate-system files that travel together
A shapefile is the .shp, .dbf, .shx and .prj files, working as one dataset.
PartWhat it holdsRequired?
.shpThe geometry: points, lines or polygonsRequired
.shxThe index that links geometry to rowsRequired
.dbfThe attribute tableRequired
.prjThe coordinate systemTreat it as required
.cpgThe text encodingWhen your text has accents

Hand someone only the .shp and their GIS refuses it, which is why converters deliver the whole set as one .zip.

How the parts fit together

Think of the set as a tiny database: feature 47 in the .shp matches row 47 in the .dbf, and the .shx ties them together by position. The link is positional, so order matters, and that is why editing the .dbf in a spreadsheet can corrupt the whole thing.

3 limits that catch people

  • Field names stop at 10 characters, and the truncation is silent: a column called population_2020 is written as population, and population_2021 then collides with it.
  • One geometry type per file, so points, lines and polygons cannot mix in the same shapefile.
  • A 2 GB ceiling on each part, which large datasets can hit.

Quieter limits

Text fields stop at 254 characters, and there is no proper date-and-time type. A blank number often becomes 0 on the way through, which is risky when 0 is a real value.

Why it is still everywhere

The answer is support: Esri created the format in the early 1990s, and thirty years of software has learned to read and write it. That history makes it the safest thing to send someone whose software you do not know.

When to move on

For desktop GIS, pick GeoPackage, which holds many layers in one file with full field names; the Shapefile converter writes it as an output, and the full specification is on the OGC GeoPackage page. For a web map, pick GeoJSON, since every mapping library reads it, and Shapefile to GeoJSON makes one in your browser. After converting, check three things: the coordinate system carried across, field names came through, and the row count matches.

“A shapefile is really a family of files. Ship only the .shp and you have handed someone geometry with no coordinate system and no attributes.”
Ghulam Hasnain, PhD researcher in Space Science & Technology and the maker of GISConverters

Frequently asked questions

What is a shapefile used for?

A shapefile stores vector data with attributes: land parcels, road networks, survey points, habitat boundaries. It is the most widely supported exchange format in GIS, which is why data portals still deliver it by default.

How do I open a shapefile without GIS software?

Convert it to a format your software reads. Shapefile to KML opens in Google Earth, and Shapefile to CSV opens in Excel. A browser-based converter does this without installing anything or uploading your data.

Should I keep a record of my field names?

Yes. Keep a data dictionary that maps each 10-character name to its full meaning, because truncated names get confusing after a couple of round trips between formats.

Why is a shapefile several files?

The format separates concerns: .shp holds geometry, .dbf holds the attribute table, .shx is the index linking them, and .prj records the coordinate system. They share a base name and must stay together, which is why shapefiles are normally shared as a single .zip.

Can I open a .shp file on its own?

Not usefully. Without the .dbf and .shx most software refuses to open it, and without the .prj the coordinates have no defined meaning. You need at least the .shp, .shx and .dbf, and should always include the .prj.

About the author

Ghulam Hasnain is a PhD researcher in space science and technology who works with GIS and remote-sensing data every day, wrangling shapefiles, KML, GPX and CAD drawings across QGIS, ArcGIS and Google Earth. He built GISConverters after one too many format conversions that required uploading sensitive survey data to a stranger's server.