All converters
HomeBlog › What is a shapefile? (and why it's really several files)

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

By Ghulam Hasnain · PhD researcher, Space Science & Technology · · Updated · 4 min read

Almost every GIS dataset you download arrives as a shapefile. But a shapefile isn't one file — and that surprises people the first time a download 'won't open'.

Advertisement

A format made of parts

The shapefile was created by Esri in the early 1990s and, despite its age, remains the default exchange format of desktop GIS. The catch is in the name's implied singularity: a “shapefile” is actually a small set of files that share a base name and must travel together.

Hand someone only the .shp and their GIS will refuse it, or open geometry with no attributes and no projection. This is exactly why converters — including this one — deliver shapefiles as a single .zip: it keeps the parts together.

How the parts fit together

Think of it as a tiny database split across files. Feature number 47 in the .shp corresponds to row 47 in the .dbf, and the .shx is the lookup table that lets software jump straight to the right byte offset instead of reading the whole file. Because the link is purely positional, deleting or reordering rows in the .dbf with a spreadsheet program is a reliable way to corrupt a shapefile.

Which parts are mandatory

Strictly, only .shp, .shx and .dbf are required for a shapefile to open. The .prj is technically optional but should be treated as mandatory in practice — without it, nothing knows whether your coordinates are degrees, metres or feet, or which datum they use. The .cpg matters whenever your attributes contain non-English characters.

The limits worth knowing

The shapefile's age shows in three constraints that regularly trip people up:

These limits are the main reason the GeoJSON and GeoPackage formats exist.

The field-name limit in practice

Truncation is silent and it collides. Export a table containing population_2020 and population_2021 and both want to become populatio; the software resolves it by renaming one to something like populati_1. After a couple of round trips through shapefile you can end up with columns nobody can identify. If your field names carry meaning, keep a data dictionary — or use a format without the limit.

Other quiet constraints

Text fields max out at 254 characters, so long descriptions get cut. There is no proper date-time type, only dates. There is no support for storing NULL cleanly — empty numbers often become 0, which is dangerous when 0 is a legitimate value. And a shapefile holds exactly one layer, so a project with roads, buildings and parcels needs three separate sets of files.

Why it is still everywhere

Given that list, it is fair to ask why the format refuses to die. The answer is universal support. Thirty years of GIS software, government portals, consultants and field equipment all read and write shapefiles, so it remains the safest thing to send someone whose setup you don't know. The specification is open and simple enough that writing a reader is a weekend project, which is precisely why support is so complete.

When to move on from shapefiles

Shapefiles are still the safest choice for interoperability — everything reads them. But if you need long field names, multiple layers in one file, or web-friendly data, consider GeoPackage (a single SQLite file with none of the limits above) or GeoJSON (ideal for web maps). You can convert a shapefile to either here: Shapefile to GeoJSON, or to KML for Google Earth and CSV for spreadsheets.

Choosing a replacement

Pick GeoPackage when you are working in desktop GIS and want one tidy file holding several layers with full-length field names and proper types — it is an OGC standard and both QGIS and ArcGIS handle it natively. Pick GeoJSON when the destination is a web map or an API, since every JavaScript mapping library reads it directly. Keep shapefile for the moment someone says "just send me the shapefile" and you have no idea what software they use.

Converting without losing anything

When moving off shapefile, check the coordinate system carried across, that field names came through at full length, and that your row count matches. Going the other direction — into shapefile — expect the 10-character truncation and be ready to split mixed geometry into separate files.

Frequently asked questions

What is a shapefile used for?

A shapefile stores vector geographic data — points, lines or polygons — together with an attribute table describing each feature. It is the most widely supported GIS exchange format, used for everything from land parcels and road networks to survey points and habitat boundaries.

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.

Why are my shapefile column names cut off?

The underlying dBASE table limits field names to 10 characters, so longer names are silently truncated and near-identical names can collide. It is a limitation of the format itself. Use GeoPackage or GeoJSON if you need full-length field names.

Is GeoPackage better than shapefile?

Technically, yes — GeoPackage is a single SQLite file with no 10-character field limit, no 2 GB ceiling, support for multiple layers and proper data types. Shapefile still wins on universal compatibility, so the right choice depends on whether you value capability or the widest possible support.

How do I open a shapefile without GIS software?

Convert it to something more common. Shapefile to KML opens in Google Earth, shapefile to CSV opens in Excel, and shapefile to GeoJSON works in any web map. A browser-based converter does this without installing anything and without uploading your data.

Related converters

Keep reading

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 GISConverter after one too many format conversions that required uploading sensitive survey data to a stranger's server.

Advertisement