Convert Shapefile to CSV
Free, private and fast: everything runs in your browser and your Shapefile files are never uploaded.
Shapefile to CSV: why convert
The attribute table of a shapefile lives in its .dbf file, which Excel and Google Sheets no longer open properly. Converting to CSV gives you that table in a form every spreadsheet, database and script can read, with one row per feature. Point shapefiles get X and Y columns with the coordinates, so the locations stay usable; lines and polygons get their geometry as WKT text. You can keep the shapefile's own coordinate system, for example metres in a UTM zone or State Plane feet, or convert the coordinates to longitude and latitude on the way. Upload the shapefile as a .zip or as loose files; several shapefiles give one CSV each. Everything runs in your browser with GDAL.
How to convert Shapefile to CSV
- Drop a .zip with your shapefile, or select the .shp, .shx, .dbf and .prj files together.
- Choose the CSV style, and enter EPSG:4326 if you want longitude and latitude.
- Click Convert to CSV and open the file in Excel or your database.
What changes when you convert
Coordinates are in the shapefile's system
By default X and Y are written in the coordinate system from the .prj file, so a shapefile in ETRS89 / UTM zone 32N gives eastings and northings in metres, such as 724787.13 and 6176406.30. For GPS-style longitude and latitude, enter EPSG:4326 as the output coordinate system. A CSV cannot store the system itself; the message after converting tells you which one the numbers are in.
Lines and polygons as WKT
A road or a parcel cannot be squeezed into two columns, so line and polygon shapefiles get a first column called WKT with the full geometry as text, such as POLYGON ((...)). Excel shows it as long text and cuts cells at 32,767 characters; GIS programs and databases can read it back as geometry.
Short field names stay short
Shapefile field names have at most 10 characters, so the CSV header has the same abbreviated names, such as DESCRIPTIO or POP_2020. Rename them in the spreadsheet if the table is meant for readers who do not know the data. Dates from the .dbf are written as 2024-05-01.
Special characters
Text is read using the encoding in the .cpg file, or the code in the .dbf header, and written as UTF-8. Choose one of the Excel styles so Excel shows letters such as é, ü or ø correctly; the semicolon style suits Excel in countries that use a decimal comma.
Several shapefiles at once
A .zip with more than one shapefile gives a zip with one CSV for each, named after the shapefiles. Spatial index, metadata and style files next to the shapefile are ignored.
About the formats
Shapefile
The Esri Shapefile is the most widely used GIS vector format. A single "shapefile" is really a set of files with the same name: .shp holds the geometry, .shx an index, .dbf the attribute table, and the optional .prj the coordinate system and .cpg the text encoding.
- Needs at least .shp, .shx and .dbf. Upload them together or as one .zip.
- Field names are limited to 10 characters and text values to 254 characters.
- Each shapefile holds one geometry type only: points, lines or polygons.
- Without a .prj file the coordinate system is unknown.
CSV
CSV (comma-separated values) is a plain-text table that opens in Excel, Google Sheets and every database. It has no geometry type of its own: locations are stored either as two coordinate columns, such as latitude and longitude, or as a column of WKT text.
- Points fit in two columns (X and Y, or longitude and latitude); lines and polygons need a WKT column.
- The coordinate system is not stored in the file, so note it separately.
- There is no standard for the separator: Excel uses a comma or a semicolon depending on the language settings.
- Every value is text; whether 0800 is a number or a postcode is up to the program reading it.
Frequently asked questions
Is my shapefile uploaded?
No. The files are read and converted by your browser on your own computer.
Can I open just the .dbf file in Excel?
Current versions of Excel no longer save .dbf files, and opening one directly can mangle special characters and dates. A CSV avoids those problems.
How do I get the table without coordinates?
Convert as usual and delete the X and Y or the WKT column in your spreadsheet. The attribute columns are the same either way.
Can I turn the CSV back into a shapefile?
A CSV with X and Y columns can be loaded in QGIS as a delimited text layer and saved as a shapefile. Use the original shapefile if you still have it, since the CSV does not record the coordinate system.