What Is a .prj File? (And How to Read, Fix, or Create One)
A .prj file is a plain-text sidecar file that defines the coordinate reference system (CRS) of a shapefile using Well-Known Text (WKT) format. You can open it in any text editor to read the projection. If yours is missing or corrupt, upload the shapefile to Projection Finder — it will detect the CRS from the coordinate data and let you download a valid replacement .prj file.
If you work with Shapefiles, you've seen the .prj file sitting in the folder next to .shp, .dbf, and .shx. It's small — sometimes just a single line — and most GIS professionals ignore it until something breaks.
When something breaks, it usually breaks badly: features landing in the ocean, coordinates off by hundreds of kilometres, or software refusing to reproject the data at all.
This guide explains what a .prj file actually contains, how to read one, and what to do when it's missing, wrong, or corrupt.
What Is a .prj File?
A .prj file is a plain-text sidecar file that stores the coordinate reference system (CRS) for a Shapefile. The Shapefile format was designed by Esri and splits geographic data across several files, each with a different role. The .prj file holds the projection definition.
Its contents are written in Well-Known Text (WKT) format — a human-readable string that describes the datum, ellipsoid, prime meridian, projection method, and units. One .prj file = one WKT string.
Key facts: One .prj per Shapefile. Plain text. WKT format. Rename it to .txt and open in any text editor. The entire file is typically a single line (though it can be formatted across multiple lines for readability).
Without the .prj file, GIS software has no way to know what coordinate system the data uses. It may display the file with an assumed CRS, silently place features in the wrong location, or refuse to perform reprojection operations.
How to Open and Read a .prj File
Any plain-text editor works: Notepad, TextEdit (in plain-text mode), VS Code, Sublime Text. You can also rename it to .prj.txt if your OS won't open it directly.
What you'll see is a WKT string. Here is a typical example for WGS84 (EPSG:4326):
GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]
Breaking that down:
GEOGCS— Geographic coordinate system (latitude/longitude). If you seePROJCSinstead, the data is in a projected system (metres or feet).DATUM— The reference frame.WGS_1984is the GPS standard.NAD83andGDA2020are common alternatives.SPHEROID— The mathematical shape of the Earth used by the datum. WGS84 uses a semi-major axis of 6,378,137 metres.PRIMEM— Prime meridian. Greenwich = 0 for almost all modern data.UNIT— Angular or linear units. Degrees for geographic CRS, metres or feet for projected.AUTHORITY["EPSG","4326"]— The EPSG registry code. If this is present, your CRS is fully identified.
For projected data, you will see an outer PROJCS wrapper with a PROJECTION element naming the method (e.g., "Transverse_Mercator", "Lambert_Conformal_Conic") and PARAMETER entries defining the projection constants.
ESRI WKT vs OGC WKT
There are two WKT dialects, and they are not identical. ESRI WKT — produced by ArcGIS — uses different naming conventions and often omits AUTHORITY tags entirely. The same WGS84 datum appears as D_WGS_1984 in ESRI format and WGS_1984 in OGC format.
| Feature | OGC WKT | ESRI WKT |
|---|---|---|
| Standard | ISO 19162 | Esri proprietary |
| AUTHORITY tag | Usually present | Often absent |
| WGS84 datum name | WGS_1984 |
D_WGS_1984 |
| CRS name | WGS 84 |
GCS_WGS_1984 |
| Common source | GDAL, QGIS, PostGIS | ArcGIS, older Shapefiles |
Both dialects represent the same projections. The practical issue is that ESRI WKT without an AUTHORITY tag requires parameter matching to identify the EPSG code, rather than a simple lookup.
Common .prj Problems
Missing .prj File
The most visible problem. Someone exported a Shapefile without writing the .prj, deleted it accidentally, or received only part of the Shapefile bundle. GIS software either assigns a default CRS or asks you to specify one.
The danger: if you assign the wrong CRS, the data will appear to display — just in the completely wrong location.
Wrong .prj File
This is the more insidious problem, and it's more common than most GIS professionals realise. The .prj file exists, the software accepts it without complaint, but it contains the wrong projection. The data displays offset from its true location — sometimes by metres, sometimes by hundreds of kilometres.
Common causes: a previous operator assigned a default CRS without checking, data was migrated between systems and the .prj was regenerated with incorrect parameters, or someone manually edited the WKT and introduced an error.
Corrupt or Empty .prj File
A .prj file that is 0 bytes or contains malformed WKT will cause software to either ignore it or throw a parse error. GDAL's gdalinfo will report "Unknown" for the CRS. The file exists — it just cannot be read.
ESRI WKT Without AUTHORITY Tags
Older Shapefiles from ArcGIS often have .prj files with ESRI-dialect WKT and no AUTHORITY["EPSG","XXXX"] tag. The CRS is technically defined, but automated tools that rely on EPSG lookup will fail to identify it. You need to match by projection parameters rather than code.
How to Identify the Correct CRS When the .prj Is Missing
When you have no .prj file, the most reliable approach is coordinate range analysis — examining the raw coordinate values in the Shapefile to infer the likely CRS.
The logic works because different coordinate systems produce numbers in distinctive ranges:
- Coordinates in the range
-180 to 180(X) and-90 to 90(Y) are consistent with a geographic CRS (degrees). The candidate pool includes WGS84, NAD83, GDA2020, and others. - Coordinates in the range of hundreds of thousands to millions, with Y values above zero for the northern hemisphere, suggest a projected system — likely UTM or a national grid.
- Negative Y values in the millions suggest a southern hemisphere projection.
- Coordinates in the range
0 to 1000suggest local or engineering coordinates with no geographic reference.
Within each category, the geographic region of the data further narrows the candidates. UTM zones are 6° wide; if you know the data covers London, you are looking at UTM Zone 30N (EPSG:32630) or the British National Grid (EPSG:27700). Context matters.
This analysis produces a ranked list of candidates with confidence scores, not a definitive answer. Always verify by previewing the data on a basemap — features should land where the real-world objects are.
How to Generate a Correct .prj File
Once you have identified the correct EPSG code, generating the .prj file is straightforward.
Using Projection Finder: Upload your Shapefile (or just the .shp and .dbf if the .prj is missing). The tool analyses the coordinates, ranks candidate CRS options by confidence, shows a map preview so you can verify visually, and generates a downloadable .prj file once you confirm the correct projection.
Using GDAL: If you know the EPSG code, run gdalsrsinfo -o wkt "EPSG:27700" and write the output to a .prj file alongside your Shapefile.
Using Python with pyproj: CRS.from_epsg(27700).to_wkt() returns the WKT string. Write that string to a file with the same base name as your Shapefile and a .prj extension.
Using QGIS: Load the Shapefile, right-click the layer, select Set CRS → Layer CRS, choose the correct CRS, then export to a new Shapefile. QGIS will write a correct .prj file.
Missing or Incorrect .prj File?
Upload your Shapefile to Projection Finder. It analyses the coordinate ranges, ranks candidate CRS options, shows a map preview for verification, and generates a correct .prj file — free, in your browser, no data leaves your machine.
When This Does NOT Help
Coordinate range analysis cannot distinguish between CRS options that produce numerically similar coordinate ranges but are geodetically different. For example, WGS84 and ETRS89 coordinates for a European dataset are nearly identical — the datum shift between them is under a metre. No tool can tell them apart from coordinates alone.
Similarly, if you have a dataset in an unknown local coordinate system — a site survey using an arbitrary origin — coordinate analysis will not identify the CRS because it does not correspond to any registered EPSG code.
In these cases, you need metadata from the data producer: a project file, a survey report, or correspondence that documents what coordinate system was used.
FAQ
A .prj file is a plain-text sidecar file that accompanies a Shapefile. It contains the coordinate reference system (CRS) definition written in Well-Known Text (WKT) format. Without it, GIS software cannot correctly place or reproject the data.
Open it in any plain-text editor — Notepad on Windows, TextEdit on macOS (plain-text mode), or a code editor such as VS Code. If your OS does not recognise the extension, rename the file to add .txt at the end. The file contains a single WKT projection string.
GIS software will either refuse to display the Shapefile, assume a default CRS (often WGS84), or prompt you to assign a projection manually. If the wrong CRS is assumed, features will appear in the wrong location — sometimes thousands of kilometres off.
Yes — and this is the more common problem. A .prj file can exist but contain the wrong projection, particularly with legacy datasets or files copied between systems. Always verify by checking whether features land in the expected location on a map.
Upload your Shapefile to Projection Finder. The tool analyses the coordinate ranges, suggests the most likely CRS with a confidence score, shows a map preview so you can verify, and generates a correct .prj file you can download. You can also use GDAL (gdalsrsinfo), pyproj, or QGIS's export function once you know the correct EPSG code.
Summary
- A
.prjfile is plain-text WKT — open it in any text editor to read the projection definition. - Look for
AUTHORITY["EPSG","XXXX"]— if present, that number is your EPSG code. - Missing is not the only problem — a
.prjcan exist and still be wrong. Always verify on a map. - Coordinate range analysis identifies likely CRS candidates when the file is absent — but always confirm visually.
- Generate a correct
.prjusing Projection Finder, GDAL, pyproj, or QGIS once you have confirmed the right EPSG code.
Related Guides
- Find Shapefile Projection — Free .prj Checker & Fixer
- Find GeoTIFF Projection — Read CRS from Any Raster File
- How to Convert WKT to EPSG Code
- NAD83 vs WGS84 — What's the Difference?
- Why Is My GIS Data Showing at 0,0?
Related Resources
- epsg.io — Look up any EPSG code and download the corresponding WKT for a
.prjfile. - spatialreference.org — Extensive reference for CRS definitions in multiple formats including ESRI WKT.