Reference·N4 Segment·N402
X12 837P Reference

N402 in X12 837P: A Field Guide to State or Province Code

Jul 28, 2026 · 4 min read
← N401 N403 →

N402 is two characters wide and looks trivial, but it's the field most payer-side edits actually check — because a state code that doesn't match its ZIP code is one of the easiest ways for a claim to bounce before anyone even looks at the clinical content.

Quick answer

N402 is the second element in the N4 segment of an X12 837P claim, carrying the standard two-letter postal abbreviation for the US state (or a comparable code for a Canadian province) tied to the address in that segment.

What populates this field in practice

US states
Two-letter postal codes — e.g. CO, NY, TX — the same abbreviations used by the USPS
Canadian provinces
Two-letter province codes — used when the address in the segment is outside the US
Consistency check
Must match N403 — payer edits commonly validate that the ZIP code in N403 actually falls within this state

Example

Synthetic example Generated by Synthibase
N4*DENVER*CO*80202

N402 value CO must correspond to both the city (DENVER) and the ZIP code (80202) that flank it in this synthetic address.

Where this trips people up

Test files often draw N402 from a short rotation of three or four familiar states, which means claim-scrubbing rules that check state/ZIP consistency, or downstream reporting that groups claims by geography, never get exercised against the full range of values a real book of business produces. It's also common to see N402 populated with a full state name instead of the two-letter code when data is generated from a spreadsheet rather than validated against the actual code set, which a strict parser will reject outright.

X12 837P N4 Segment Guide: Fields, Format, and Testing Gotchas
What Is X12 837P? The Complete Guide
How to Validate X12 EDI Files Before Payer Submission
Cover more than a handful of states in your test data
Synthibase generates synthetic 837P claims spanning realistic state and ZIP combinations across the full US, not a fixed rotation of familiar cities, so your geography-dependent validation logic gets a real workout.
Start free trial →
This page is written independently by Synthibase for testing and informational purposes. It is not an official publication of HL7 International or X12/Washington Publishing Company, and is not a substitute for reviewing the official standard or your trading partner's companion guide. See our Terms of Service for full legal terms.