Skip to main content

N4 — Geographic Location

X12 N4 segment reference: city, state/province, postal code, and country that complete an N1/N3 address block for ship-to and remit-to routing.

N4 segment facts

  • N4 completes the geographic part of an N1 address block — city, state, postal, and country used for routing and tax logic.
  • State and postal-code validation in N4 is a common silent failure point for cross-DC and cross-border shipments.
  • SignalEDI validates N4 state/postal formats against partner profiles before outbound documents leave the sandbox.

What the N4 segment does

N4 completes the address for a party in an N1 loop by carrying city, state or province, postal code, and country code. It follows N3 street lines and is used for routing and tax determination.

Loop: N1 loop (after N3)

Common transaction sets: 850, 856, 810, 855

Key elements

ElementNameDescription
N401City nameCity for the party's address.
N402State or province codeTwo-character code; required by most US partners.
N403Postal codeZIP or postal code; format validated by partner rules.
N404Country codeISO country code; often US when omitted.

Example N4 segment

N4*Columbus*OH*43004*US~

Parse and validate samples with the free EDI validator or send JSON via the JSON→X12 mapping guide.

Common N4 errors

  • Invalid or missing state code for a US ship-to
  • Postal code format mismatch (ZIP+4 vs 5-digit) against partner spec
  • N4 present without the preceding N1/N3 context

Related reference

Frequently asked questions

© 2026 SignalEDI Inc. All rights reserved.