IRS SOI Individual Income Tax Statistics ZIP Code Data 2021 (with AGI)
- Rows
- 166,221
- Columns
- 167
- Data range
- 0 to 99999
ZIP Code data showing selected income and tax items classified by State, ZIP Code, and size of adjusted gross income for tax year 2021. Includes number of returns, AGI, wages, dividends, interest, etc. Federal IRS SOI data, all states combined CSV.
AI analysis
IRS SOI ZIP Code Income Tax Data 2021 — Analytical Overview
1. Dataset Representation and Research Value
This dataset originates from the IRS Statistics of Income (SOI) division, published at https://www.irs.gov/pub/irs-soi/21zpallagi.csv, making it an authoritative, federally sourced snapshot of tax year 2021 filing behavior across the United States. The data is structured as a panel of ZIP code × AGI bracket combinations, with each of the 166,221 rows representing one of six income strata (agistub 1–6) within a given ZIP code. With 167 columns spanning return counts, wages, dividends, capital gains, deductions, credits, and tax liability, this is one of the richest publicly available geographic income datasets in existence. Its primary value for correlation studies lies in its ability to connect geographic income composition (wages vs. investment income vs. retirement income) with virtually any ZIP-level socioeconomic indicator — housing, education, health, consumer behavior, or demographic data.
---
2. Data Quality Observations
Data quality here is exceptionally clean by most measures: all 166,221 rows report zero null cells across all 167 columns, which is rare for a dataset of this size and breadth. No type mismatches are reported. However, several quality nuances deserve attention. The zipcode field ranges from 0 to 99999 with a mean of ~48,877 and 27,605 distinct values — the presence of zipcode = 0 rows (a known IRS convention for non-geographic or suppressed filings) should be filtered before any spatial join. Outlier counts are pervasive and structurally expected: columns like mars1 (single filers) report 22,083 outliers, A26270 (partnership/S-corp income) flags 27,747, and A59660 (Earned Income Credit amounts) shows 30,022 — these reflect the extreme concentration of high-income filers in a small number of dense urban ZIP codes rather than data errors. The duplicate row count is noted as pending Phase D recomputation, which warrants verification before aggregation, since accidental ZIP × AGI duplicates would silently inflate totals. Columns like VITA, TCE, VITAEIC, N09600, and N19500 have medians and Q1/Q3 values all at zero, indicating sparse, highly specialized fields that apply only to narrow filer populations and should be treated as zero-inflated in any regression framework.
---
3. Key Column Distributions and Notable Patterns
The most analytically central columns reveal profound right-skew throughout. A00100 (total AGI) has a mean of $177,123 but a median of only $18,503 — a ratio exceeding 9:1 — with skewness of 141 and 18,185 flagged outliers, reflecting the well-documented concentration of income at the top of the distribution. A00200 (wages and salaries) similarly shows mean $107,228 vs. median $12,053 (skew=122). In contrast, A01700 (IRA distributions) has a mean of $10,136 and median of $1,577, with lower skew (84.6), suggesting a broader geographic spread of retirement income. A01000 (net capital gains) is among the most extreme: mean $22,014, median just $349, skew=181, with 22,889 outliers — this column will be highly sensitive to a handful of ultra-high-income ZIP codes. A26270 (partnership/S-corp net income) includes negative values (min = -$202,543), spans to $128M, carries skew of 160, and has the highest outlier count at 27,747, making it the most volatile income component. Filing behavior columns like ELF (electronic filing, mean=1,754, median=260) and PREP (paid preparer usage, mean=993, median=160) also show extreme concentration, useful as proxies for tax sophistication or access to professional services by geography.
---
4. Recommended Join Key Columns
The natural composite join key is (zipcode, agistub), which uniquely identifies each row and enables income-stratified cross-dataset analysis. For simpler ZIP-level joins (collapsing across income brackets), zipcode alone serves as the primary spatial key after aggregating or filtering agistub. STATEFIPS and STATE support state-level rollups and joins to FIPS-coded government datasets (Census, BLS, CDC). A critical caveat: IRS ZIP codes do not perfectly align with USPS ZIP codes or Census ZCTAs — a ZIP-to-ZCTA crosswalk (available from HUD or the Census Bureau) is strongly recommended before joining to any Census-derived dataset. Rows where zipcode = 0 or ZIP codes with very low N1 values (number of returns < 10, common in suppressed rural ZIPs) should be excluded or flagged to avoid spurious correlations driven by small-sample noise.
---
5. High-Value Datasets for Correlation Pairing
Several external datasets would unlock powerful analyses when joined to this data:
- Census ACS 5-Year Estimates (ZIP/ZCTA level): Correlate AGI components with educational attainment, race/ethnicity, housing costs, and commute times — directly testable hypotheses around income inequality geography. - HUD Fair Market Rents or Zillow ZHVI (ZIP level): A00100 and A00200 vs. median home values or rents would quantify affordability stress and housing wealth effects by income bracket. - BLS Quarterly Census of Employment and Wages (QCEW) by county: Map wage income (A00200) against local industry composition to identify ZIP codes where non-wage income dominates — a signal of investor-class geography. - CDC PLACES or CMS Medicare data (county/ZIP): Link high A01700 (IRA/retirement income) and ELDERLY filer counts to health outcomes, enabling actuarial and public health research. - SBA PPP/EIDL loan data or FDIC deposit data (ZIP level): A00900 (business income) and A26270 (pass-through income) correlate naturally with small business density and banking access patterns. - FEC campaign finance data (ZIP level): High-AGI ZIPs with elevated A01000 (capital gains) and A00600 (dividends) are known predictors of political donation behavior — a compelling political economy correlation study.
Columns
- zipcode (integer)
- agi_stub (integer)
- STATEFIPS (integer)
- STATE (string)
- N1 (decimal)
- mars1 (decimal)
- MARS2 (decimal)
- MARS4 (decimal)
- ELF (decimal)
- CPREP (decimal)
- PREP (decimal)
- DIR_DEP (decimal)
- VRTCRIND (decimal)
- N2 (decimal)
- TOTAL_VITA (decimal)
- VITA (decimal)
- TCE (decimal)
- VITA_EIC (decimal)
- RAC (decimal)
- ELDERLY (decimal)
- A00100 (decimal)
- N02650 (decimal)
- A02650 (decimal)
- N00200 (decimal)
- A00200 (decimal)
- N00300 (decimal)
- A00300 (decimal)
- N00600 (decimal)
- A00600 (decimal)
- N00650 (decimal)
- A00650 (decimal)
- N00700 (decimal)
- A00700 (decimal)
- N00900 (decimal)
- A00900 (decimal)
- N01000 (decimal)
- A01000 (decimal)
- N01400 (decimal)
- A01400 (decimal)
- N01700 (decimal)
- A01700 (decimal)
- SCHF (decimal)
- N02300 (decimal)
- A02300 (decimal)
- N02500 (decimal)
- A02500 (decimal)
- N26270 (decimal)
- A26270 (decimal)
- N02900 (decimal)
- A02900 (decimal)
- N03220 (decimal)
- A03220 (decimal)
- N03300 (decimal)
- A03300 (decimal)
- N03270 (decimal)
- A03270 (decimal)
- N03150 (decimal)
- A03150 (decimal)
- N03210 (decimal)
- A03210 (decimal)
- N02910 (decimal)
- A02910 (decimal)
- N04450 (decimal)
- A04450 (decimal)
- N04100 (decimal)
- A04100 (decimal)
- N04200 (decimal)
- A04200 (decimal)
- N04470 (decimal)
- A04470 (decimal)
- A00101 (decimal)
- N17000 (decimal)
- A17000 (decimal)
- N18425 (decimal)
- A18425 (decimal)
- N18450 (decimal)
- A18450 (decimal)
- N18500 (decimal)
- A18500 (decimal)
- N18800 (decimal)
- A18800 (decimal)
- N18460 (decimal)
- A18460 (decimal)
- N18300 (decimal)
- A18300 (decimal)
- N19300 (decimal)
- A19300 (decimal)
- N19500 (decimal)
- A19500 (decimal)
- N19530 (decimal)
- A19530 (decimal)
- N19550 (decimal)
- A19550 (decimal)
- N19570 (decimal)
- A19570 (decimal)
- N19700 (decimal)
- A19700 (decimal)
- N20950 (decimal)
- A20950 (decimal)
- N04475 (decimal)
- A04475 (decimal)
- N04800 (decimal)
- A04800 (decimal)
- N05800 (decimal)
- A05800 (decimal)
- N09600 (decimal)
- A09600 (decimal)
- N05780 (decimal)
- A05780 (decimal)
- N07100 (decimal)
- A07100 (decimal)
- N07300 (decimal)
- A07300 (decimal)
- N07180 (decimal)
- A07180 (decimal)
- N07230 (decimal)
- A07230 (decimal)
- N07240 (decimal)
- A07240 (decimal)
- N07225 (decimal)
- A07225 (decimal)
- N07260 (decimal)
- A07260 (decimal)
- N09400 (decimal)
- A09400 (decimal)
- N85770 (decimal)
- A85770 (decimal)
- N85775 (decimal)
- A85775 (decimal)
- N10600 (decimal)
- A10600 (decimal)
- N59660 (decimal)
- A59660 (decimal)
- N59720 (decimal)
- A59720 (decimal)
- N11070 (decimal)
- A11070 (decimal)
- N10960 (decimal)
- A10960 (decimal)
- N11560 (decimal)
- A11560 (decimal)
- N11450 (decimal)
- A11450 (decimal)
- N11520 (decimal)
- A11520 (decimal)
- N11530 (decimal)
- A11530 (decimal)
- N10970 (decimal)
- A10970 (decimal)
- N10971 (decimal)
- A10971 (decimal)
- N06500 (decimal)
- A06500 (decimal)
- N10300 (decimal)
- A10300 (decimal)
- N85530 (decimal)
- A85530 (decimal)
- N85300 (decimal)
- A85300 (decimal)
- N11901 (decimal)
- A11901 (decimal)
- N11900 (decimal)
- A11900 (decimal)
- N11902 (decimal)
- A11902 (decimal)
- N12000 (decimal)
- A12000 (decimal)