Create a shapefile from CSV in QGIS
How to turn a CSV of coordinates into a shapefile in QGIS, what the conversion changes in your data, and when GeoPackage or plain CSV is the better choice.
Turning a CSV file into a shapefile in QGIS is a two-stage job. First, QGIS reads the delimited text and builds point (or other) geometry from columns you choose. Second, that temporary layer is written out in the ESRI Shapefile format. The process is short, but the second stage changes your data in ways that matter: field names, field types and text encoding are all subject to the shapefile's older format rules. This review covers what each stage does, what you can lose along the way and when another output format serves you better.
Is converting CSV to a shapefile the right move?
Convert to a shapefile when a recipient, a piece of software or a submission process specifically requires that format. The main benefit is compatibility: almost every GIS application can open a shapefile. The decisive tradeoff is that the format constrains your attribute table more tightly than CSV does. Long column names get shortened, some data types are simplified and the result is several files that must travel together rather than one.
If you only need to view or analyze the points inside QGIS, you can work directly with the delimited text layer, or save it as a GeoPackage. GeoPackage is a single file and avoids the shapefile's 10-character field-name limit. Keeping the plain CSV is preferable when the data will keep being edited in a spreadsheet, when other people need to read it without GIS software, or when the coordinates are just one column among many and nobody downstream needs real geometry.
What you need in the CSV before you start
- A header row with one distinct name per column.
- A consistent delimiter throughout the file, such as a comma, tab or semicolon.
- Coordinate columns holding plain numbers, such as longitude and latitude or projected X and Y values. Alternatively, one column holding geometry as WKT (well-known text).
- Knowledge of which coordinate reference system (CRS) the coordinates use. Longitude and latitude from GPS devices or web services are commonly WGS 84 (EPSG:4326), but confirm this for your source rather than assuming it.
- A known text encoding, ideally UTF-8, so that accented or non-Latin characters survive the import.
The illustrative CSV below uses longitude and latitude columns. The values are placeholders that show the expected structure; they are not real locations.
site_id,site_name,zip,lon,lat
1,North Depot,02134,-71.10,42.35
2,River Station,02139,-71.09,42.36
Step-by-step: from CSV layer to shapefile
The menu wording below follows recent QGIS releases. Labels can differ slightly between versions, so check against the version you have installed.
- 1. Open the Data Source Manager and choose the Delimited Text tab. You can reach it through Layer > Add Layer > Add Delimited Text Layer.
- 2. Select your CSV file and set the file format. Choose CSV for comma-separated files, or Custom delimiters for tabs, semicolons or other separators.
- 3. Check the record and field options. Confirm that the first record contains field names, and decide whether QGIS should detect field types automatically.
- 4. Under Geometry Definition, choose Point coordinates. Set the X field to your longitude or easting column and the Y field to your latitude or northing column. If your file holds WKT instead, choose Well known text (WKT) and pick that column.
- 5. Set the geometry CRS to match your coordinates.
- 6. Check the sample preview at the bottom of the dialog, then add the layer and confirm the points appear where you expect.
- 7. Right-click the new layer in the Layers panel and choose Export > Save Features As.
- 8. Set Format to ESRI Shapefile, choose a file name and location, set the CRS you want the output to use and set the encoding (UTF-8 is a reasonable default).
- 9. Save, then open the resulting shapefile and inspect its attribute table.
Step 9 is not optional housekeeping. It is the only way to see what the format conversion actually did to your columns.
What the conversion actually changes
A CSV stores everything as text, and the coordinates are just more text. QGIS's delimited text provider interprets that text by building geometry from the coordinate columns and assigning each column a type, such as integer, decimal or string, either through automatic detection or through rules you supply. Writing a shapefile then stores the geometry in the .shp file and the attributes in a dBASE (.dbf) table. The dBASE format brings its own rules. Most surprises come from this hand-off.
| Aspect | In the CSV | In the shapefile |
| Field names | Any length | Limited to 10 characters; longer names are truncated, and duplicates after truncation are altered to stay unique |
| Text values | Any length | String fields hold at most 254 characters |
| Date and time | Stored as text | Date type supported; combined date-time values are not handled natively by the format |
| Geometry | Coordinates as ordinary columns | One geometry type per file, such as all points |
| Storage | One file | Several files sharing a base name |
Leading zeros are a common casualty that happens before the shapefile is written. If automatic type detection treats a column such as a ZIP code or a padded ID as an integer, a value like 02134 becomes 2134. To prevent this, turn off type detection for the import, or supply a .csvt companion file that declares that column as a string. A .csvt file is a one-line file with the same base name as the CSV that lists each column's type.
The coordinate columns themselves are usually kept as ordinary attributes alongside the new geometry. If the output CRS differs from the input CRS, the geometry is reprojected, but those copied attribute values still hold the original numbers. Anyone reading the table needs to know which CRS those columns refer to.
Will the shapefile stay usable after you share it?
A shapefile is a set of files. The .shp (geometry), .shx (index) and .dbf (attributes) files are required. The .prj file records the CRS, and a .cpg file, when written, records the text encoding. Sending only the .shp file leaves the recipient with nothing usable. Omitting the .prj file means their software has to guess the CRS, and omitting the .cpg file can garble non-ASCII text. Compress all files sharing the base name into one archive before sending.
Truncated field names are the main readability cost. A column called customer_category might come out as customer_c, which can be meaningless to someone who never saw the original CSV. Rename long fields to short, clear names before exporting, or keep a separate list mapping old names to new ones.
Individual shapefile components also have a commonly cited size ceiling of about 2 GB. Very large point datasets are better saved as GeoPackage.
How a specific recipient application handles encoding, dates or reprojection depends on that application. No tested results for particular destination software were available for this review, so test-open the shapefile in the software your recipient uses rather than assuming it will behave like QGIS.
Common problems and quick checks
- No points appear: the X and Y fields may be swapped. Longitude belongs in X and latitude in Y.
- Points land in the wrong place, such as off the coast of Africa near 0,0: the CRS is wrong, or coordinates are missing or zero in some rows.
- Coordinates are read as text: the file may use a comma as the decimal separator. Enable the option for comma decimal separators in the import dialog, or clean the column first.
- Accented characters look garbled: the import encoding does not match the file. Re-add the layer with the correct encoding, then export with UTF-8.
- Column names are cut off or have digits appended: these are the shapefile's 10-character name limit and uniqueness rule at work. Rename the fields before export.
Bottom line
QGIS turns a CSV into a shapefile reliably as long as the coordinates are clean and the CRS is known. Before you share the result, check that it still means what the CSV meant. Look for truncated field names, lost leading zeros, encoding issues and missing companion files. If no one specifically requires a shapefile, GeoPackage gives you the same geometry with fewer constraints, and the original CSV remains the most readable copy for people working outside GIS.