Try the Tool Free

How to Convert WKT to EPSG Code

Published: January 2025 Read time: 5 minutes

You've got a WKT (Well-Known Text) string from a .prj file or GIS software, and you need the EPSG code. Maybe your code requires EPSG:4326 instead of a long WKT definition, or you need to look up the projection details.

This guide shows you how to convert WKT to EPSG codes quickly.

Quick Answer: How to Convert WKT to EPSG

Fastest method: Paste your WKT into epsg.io search box. It parses the string and returns matching EPSG codes. Or check if AUTHORITY["EPSG","XXXX"] already exists in your WKT—that's the EPSG code.

What Is WKT?

WKT (Well-Known Text) is a text format for representing coordinate reference systems. It defines the projection, datum, units, and parameters in a structured, readable format.

Example WKT (WGS84)

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"]]

The AUTHORITY["EPSG","4326"] at the end tells you this is EPSG:4326 (WGS84).

Method 1: Check for AUTHORITY Tag

Many WKT strings already contain the EPSG code. Search for:

AUTHORITY["EPSG","XXXX"]

The number after "EPSG" is your code. In the example above, it's 4326.

Where to Find It

Method 2: Use epsg.io

  1. Go to epsg.io
  2. Paste your entire WKT string into the search box
  3. The site parses the WKT and shows matching EPSG codes

This works even if your WKT doesn't have an AUTHORITY tag—epsg.io matches the projection parameters.

Method 3: Use Projection Finder

If you have a file (Shapefile with .prj, GeoTIFF, etc.):

  1. Upload to projectionfinder.com
  2. The tool extracts the CRS and shows the EPSG code
  3. Verify visually on the map preview

Got a File Instead of WKT?

Drop your Shapefile or GeoTIFF and get the EPSG code automatically.

Open Projection Finder

OGC WKT vs ESRI WKT

There are two main WKT flavors, which can cause confusion:

Feature OGC WKT ESRI WKT
Standard ISO 19162 ESRI proprietary
AUTHORITY tag Usually present Often missing
WGS84 name "WGS 84" "GCS_WGS_1984"
Common source GDAL, PostGIS, QGIS ArcGIS, .prj files

ESRI WKT Example (No AUTHORITY)

GEOGCS["GCS_WGS_1984",
    DATUM["D_WGS_1984",
        SPHEROID["WGS_1984",6378137,298.257223563]],
    PRIMEM["Greenwich",0],
    UNIT["Degree",0.017453292519943295]]

This is WGS84 (EPSG:4326) but has no AUTHORITY tag. Use epsg.io to match it.

Method 4: Python with pyproj

from pyproj import CRS

wkt = '''GEOGCS["WGS 84",DATUM["WGS_1984",
    SPHEROID["WGS 84",6378137,298.257223563]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433]]'''

crs = CRS.from_wkt(wkt)
print(f"EPSG: {crs.to_epsg()}")  # Output: 4326

Method 5: GDAL/ogr2ogr

# From a .prj file
gdalsrsinfo -o epsg yourfile.prj

# From WKT string
echo 'GEOGCS["WGS 84"...]' | gdalsrsinfo -o epsg /vsistdin/

Common WKT → EPSG Mappings

WKT Name EPSG Description
GCS_WGS_1984 / WGS 84 4326 GPS coordinates (lat/lon)
WGS_1984_Web_Mercator 3857 Google Maps, web tiles
NAD_1983 / NAD83 4269 North American Datum
British_National_Grid 27700 UK Ordnance Survey
WGS_1984_UTM_Zone_10N 32610 UTM Zone 10 North

FAQ

How do I convert WKT to EPSG code?

Search for AUTHORITY["EPSG","XXXX"] in the WKT—that's your EPSG code. If not present, paste the WKT into epsg.io or use pyproj to match the parameters against the EPSG database.

What is WKT (Well-Known Text)?

WKT is a text markup language for representing coordinate reference systems. It defines projection parameters, datum, and units in a human-readable format used in .prj files and GIS databases.

Why doesn't my WKT have an EPSG code?

ESRI-style WKT often omits AUTHORITY tags. Custom or modified projections also won't have EPSG codes. Use epsg.io to match the WKT parameters against known EPSG definitions.

What's the difference between OGC WKT and ESRI WKT?

OGC WKT follows ISO 19162 and includes AUTHORITY tags with EPSG codes. ESRI WKT uses different naming (like "GCS_WGS_1984" vs "WGS 84") and often lacks EPSG codes. Both represent the same projections.

How do I read the EPSG code from a .prj file?

Open the .prj file in a text editor—it contains WKT. Search for AUTHORITY["EPSG", followed by a number. If not present, paste the WKT into epsg.io or upload the shapefile to Projection Finder.

Summary

  1. Check for AUTHORITY tag — The EPSG code may already be in the WKT
  2. Use epsg.io — Paste WKT to find matching EPSG codes
  3. Use Projection Finder — Upload files to extract CRS automatically
  4. Know OGC vs ESRI — ESRI WKT often lacks EPSG codes but epsg.io can match it

Related Guides