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

So what is a shapefile? Almost every GIS dataset you download arrives as one. However, a shapefile is not a single file. That surprises people the first time a download will not open.

Advertisement

A format made of several files

Esri created the shapefile in the early 1990s. Even so, it is still the common language of desktop GIS. However, the name misleads people. It is really a small set of files. They share one base name. They must travel together.

What is a shapefile: the .shp geometry, .dbf attributes, .shx index and .prj coordinate-system files that travel together
What is a shapefile? It is the .shp, .dbf, .shx and .prj files, working as one dataset.

So hand someone only the .shp, and their GIS refuses it. That is why converters deliver it as one .zip.

How the parts fit together

Think of it as a tiny database. Feature number 47 in the .shp matches row 47 in the .dbf. The .shx links them by position. So editing the .dbf in a spreadsheet can corrupt the whole thing. Because the link is positional, order matters.

Which parts are mandatory

Strictly, only three parts are required. Those are the .shp, the .shx and the .dbf. However, treat the .prj as mandatory too. Without it, nothing knows if the coordinates are degrees or metres. The .cpg matters when your text uses accents.

The limits worth knowing

The format is old, so its age shows. Three limits trip people up most often.

The field-name limit in practice

Truncation is silent, and it collides. For example, two long names can both shrink to the same word. Then the software renames one. So after a couple of round trips, columns get confusing. Therefore keep a data dictionary, or use a format without the limit.

Other quiet constraints

Text fields stop at 254 characters. Also, there is no proper date-time type. There is no clean way to store an empty number either. So a blank often becomes 0, which is risky when 0 is real.

Why it is still everywhere

Given that list, why does the format survive? The answer is support. Thirty years of software reads and writes it. So it is the safest thing to send someone. Also, the spec is open and simple. Because of that, support is nearly universal.

When to move on from the shapefile

The format is still the safe choice for sharing. However, sometimes you need more. So consider two modern options.

Choosing a replacement

Pick GeoPackage for desktop GIS. It holds many layers in one file, with full field names. Alternatively, pick GeoJSON for a web map, because every mapping library reads it. You can read the official spec at the OGC GeoPackage page.

Converting without losing data

You can convert a shapefile in your browser. For example, try Shapefile to GeoJSON, or Shapefile to KML for Google Earth. After converting, check three things. First, the coordinate system carried across. Next, field names came through in full. Finally, the row count matches. In short, once you know what a shapefile is, these limits are easy to plan around.

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