How to download the NPPES NPI file and build a list of medical practices
Download the free NPPES NPI registry file, load its 9.6 million records with Python and DuckDB, and clean it into a list of U.S. medical practices.
The National Plan and Provider Enumeration System (NPPES) is the federal registry of National Provider Identifiers (NPIs). Every individual provider and organization that bills a U.S. health plan has an NPI. The Centers for Medicare & Medicaid Services (CMS) publishes the full registry as a free monthly download, and most commercial lists of medical practices are built from it.
This guide is for founders, sales and revenue leaders, and go-to-market (GTM) engineers who sell to medical practices. The NPI file is a common starting point for lead generation, lead research, market segmentation and total addressable market (TAM) calculations in healthcare. The guide covers downloading the file, loading it with Python and DuckDB, the structure of a record, and the data issues to handle before using it.
Rather not build it yourself? Narwhalim is a searchable database of U.S. medical practices for sales teams. Start browsing free: any specialty, any state, the top 25 practices. No card.
All counts are from the June 2026 file.
What is in the NPPES NPI file
Type 1 and Type 2 NPIs
Each row is one NPI. There are two entity types:
- Type 1 NPIs belong to individual providers, such as physicians, nurse practitioners and counselors. The June 2026 file has 7,323,142 active Type 1 records.
- Type 2 NPIs belong to organizations, such as group practices, clinics, pharmacies and home health agencies. The file has 1,937,362 active Type 2 records.
Record fields
Each record includes the legal name, practice location address and phone number, mailing address, up to 15 taxonomy (specialty) codes, the authorized official for organizations, and enumeration and update dates. The main file has 330 columns. This guide uses 21.
How to download the NPPES NPI file
CMS publishes the files at download.cms.gov/nppes/NPI_Files.html. Use the monthly full file. The weekly files contain only incremental changes. The file name includes the month and year:
curl -LO https://download.cms.gov/nppes/NPPES_Data_Dissemination_June_2026_V2.zip
unzip NPPES_Data_Dissemination_June_2026_V2.zip
The zip file is 1.1 GB and extracts to 11.5 GB. It contains four data files:
| File | Contents |
|---|---|
npidata_pfile_…csv |
Main registry: 9,606,683 rows |
pl_pfile_…csv |
Secondary practice locations: 1,208,019 rows |
othername_pfile_…csv |
Other organization names: 854,910 rows |
endpoint_pfile_…csv |
Electronic addresses for exchanging patient records |
How to load the NPI file with Python and DuckDB
The main file is an 11.5 GB comma-separated values (CSV) file with 9.6 million rows. Excel's limit is 1,048,576 rows. DuckDB is a free database that runs inside a Python script and queries CSV files directly (pip install duckdb). The script below keeps 21 columns and removes deactivated records. It ran in 30 seconds on a laptop.
import duckdb
SRC = "npidata_pfile_20050523-20260607.csv" # the date range in the name changes every month
slots = range(1, 16)
codes = ", ".join(f'"Healthcare Provider Taxonomy Code_{i}"' for i in slots)
primary = ", ".join(
f"""CASE WHEN "Healthcare Provider Primary Taxonomy Switch_{i}" = 'Y'
THEN "Healthcare Provider Taxonomy Code_{i}" END"""
for i in slots
)
con = duckdb.connect("registry.duckdb")
con.execute(f"""
CREATE OR REPLACE TABLE registry AS
SELECT
"NPI" AS npi,
"Entity Type Code" AS entity_type,
"Provider Organization Name (Legal Business Name)" AS org_name,
"Provider Other Organization Name" AS other_name,
"Provider First Name" AS first_name,
"Provider Last Name (Legal Name)" AS last_name,
"Provider Credential Text" AS credential,
"Provider First Line Business Practice Location Address" AS address,
"Provider Business Practice Location Address City Name" AS city,
"Provider Business Practice Location Address State Name" AS state,
"Provider Business Practice Location Address Postal Code" AS zip,
"Provider Business Practice Location Address Telephone Number" AS phone,
"Authorized Official First Name" AS official_first,
"Authorized Official Last Name" AS official_last,
"Authorized Official Title or Position" AS official_title,
"Authorized Official Telephone Number" AS official_phone,
"Is Sole Proprietor" AS sole_proprietor,
"Is Organization Subpart" AS is_subpart,
"Last Update Date" AS last_update,
list_filter([{codes}], x -> x IS NOT NULL) AS taxonomy_codes,
coalesce({primary}, "Healthcare Provider Taxonomy Code_1") AS primary_taxonomy
FROM read_csv('{SRC}', header = true, all_varchar = true)
WHERE "Entity Type Code" IS NOT NULL -- deactivated records: every field blank but the NPI
""")
The script loads every column as text (all_varchar = true). With numeric types, NPIs and ZIP codes lose leading zeros. 786,003 records have a ZIP code that starts with zero (New England, New Jersey and Puerto Rico). 92% of ZIP codes in the file use the nine-digit format. Use the first five digits for matching.
NPPES data issues to handle
Deactivated NPIs
The file includes 346,179 deactivated NPIs. In these rows, every field except the NPI and the deactivation date is blank, including the entity type. The WHERE "Entity Type Code" IS NOT NULL filter in the script removes them.
The primary taxonomy code is not always in slot 1
Each record lists up to 15 taxonomy codes and flags one as primary in the Healthcare Provider Primary Taxonomy Switch columns. The primary code is not always the first one listed. This applies to 376,990 organizations (19.5%) and 731,704 individuals (10.0%). The script reads the switch into primary_taxonomy and keeps every listed code in taxonomy_codes.
I wrote more about matching on taxonomy codes here: How to find medical practices by specialty with NPI taxonomy codes.
Practice location address and mailing address
Each record has a practice location address and a mailing address. The mailing address can belong to a billing service or a head office. For 200,466 organizations (10.3%), the two addresses are in different states. Use the practice location address to locate a practice.
Secondary practice locations
The main file has one practice location per NPI. Organizations list additional locations in the secondary practice location file (pl_pfile, 1,208,019 rows), which joins on NPI. Without this file, a multi-location organization shows a single address.
Legal business name and other names
The legal business name often differs from the name a practice operates under. 513,488 organizations (26.5%) list an other organization name in the main file, and the other-names file (othername_pfile) has 854,910 rows. Search both when matching by practice name.
Sole proprietors
2,357,846 individual records (32%) are marked as sole proprietors. A sole proprietor can bill under an individual NPI without a Type 2 organization record. A list built from Type 2 records only does not include these practices. Include Type 1 sole proprietors if the target market includes single-provider practices.
The authorized official field
Each Type 2 record names an authorized official: the person who signed the NPI registration for the organization, with a title and a phone number. All 1,937,362 active organization records include the phone number. The most common titles:
| Title | Organizations |
|---|---|
| Owner | 352,207 |
| President | 255,926 |
| Chief executive officer | 135,240 |
| Manager | 46,396 |
| Administrator | 44,154 |
| Office manager | 26,806 |
For prospecting, this gives a named contact with a role on every organization record. The phone number may be the main practice line rather than a direct line.
How current is NPPES data
CMS rebuilds the file every month, but a record changes only when the provider updates it. 561,524 organization records (29%) were last updated before 2015. 338,769 (17.5%) were updated in 2025 or later. The Last Update Date column can be used to filter or flag older records.
What the NPI file does not include
The 1,937,362 active Type 2 records do not correspond to 1,937,362 medical practices:
- Many are not practices: home health agencies, pharmacies, medical equipment suppliers and transportation services.
- One practice can hold several NPIs, for example one per location or department.
- The file has no reliable ownership data.
- The file has no patient or billing volume.
Skip the build
Narwhalim is a database of U.S. medical practices for sales teams. Search by specialty and state, and each practice comes with its locations, phone numbers, the people who run it, its size and activity, which electronic health record (EHR) system it uses, and whether it's affiliated with a health system.
Start browsing free: search any specialty and state and see the top 25 practices. No card.
Just need one list? Build it here and pay per practice.