EDIFACT UNB segment: interchange header.

The UNB segment opens an EDIFACT interchange. It contains the syntax identifier and version, sender identification (with qualifier), recipient identification (with qualifier), preparation date and time, and the interchange control reference. Every UNB must have a matching UNZ at the end of the interchange.

Tag
UNB
Full name
Interchange header
Part of the message
Interchange envelope
Data elements
11

A UNB segment, explained

Hover any part of the segment to see what it is. Open What your system receives to see the JSON or XML CleanEDI delivers.

  1. UNB+UNOA:2+9322000000456:ZZ+9311000000123:ZZ+260823:0900+CTRL-001'
    UNBInterchange header

    Interchange from 9322000000456 to 9311000000123, prepared 23 August 2026 at 09:00. Control reference CTRL-001.

    UNB
    Interchange header
    UNOA
    Level A: uppercase letters and digits (syntax character set)
    ZZ
    Mutually agreed (sender id type)

UNB structure

Elements are separated by + and their parts by :. Positions match the explainer, so 2.3 is the third part of the second element.

PositionElementParts
1Syntax1.1 Character set, 1.2 Syntax version
2Sender2.1 ID, 2.2 ID type
3Recipient3.1 ID, 3.2 ID type
4Prepared4.1 Date (YYMMDD), 4.2 Time (HHMM)
5Interchange control referenceSingle value
6Recipient passwordSingle value
7Application referenceSingle value
8Processing prioritySingle value
9Acknowledgement requestSingle value
10Agreement IDSingle value
11Test indicatorSingle value

Syntax: Character set (1.1)

CodeMeaning
UNOALevel A: uppercase letters and digits
UNOBLevel B: upper and lower case
UNOCISO 8859-1 (Latin-1)
UNODISO 8859-2 (Latin-2)
UNOWUTF-8
UNOYISO 10646 (Unicode)

Sender: ID type (2.2)

CodeMeaning
1DUNS number
14GS1 Global Location Number (GLN)
30ISO 6523 organisation ID
ZZZMutually agreed
ZZMutually agreed

Recipient: ID type (3.2)

CodeMeaning
1DUNS number
14GS1 Global Location Number (GLN)
30ISO 6523 organisation ID
ZZZMutually agreed
ZZMutually agreed

Common EANCOM and UN/EDIFACT values. Your trading partner's implementation guide is the final word on which codes they send.

UNB segment FAQ

Have a real message with UNB in it? The explainer breaks down every segment and runs in your browser.

Explain my message

What is the UNB segment in EDIFACT?

UNB is the Interchange Header segment. The UNB segment opens an EDIFACT interchange. It contains the syntax identifier and version, sender identification (with qualifier), recipient identification (with qualifier), preparation date and time, and the interchange control reference. Every UNB must have a matching UNZ at the end of the interchange.

What are the common UNB syntax: character set codes?

UNOA means level a: uppercase letters and digits; UNOB means level b: upper and lower case; UNOC means iso 8859-1 (latin-1); UNOD means iso 8859-2 (latin-2); UNOW means utf-8; UNOY means iso 10646 (unicode).

Where does UNB appear in an EDIFACT message?

UNB belongs to the interchange envelope part of a message, alongside UNA.

How do I read a UNB segment in my own message?

Paste the message into the free CleanEDI explainer. It breaks every UNB segment into its elements, translates the codes and shows the JSON and XML your system would receive. Nothing you paste leaves your browser.

Related segments in interchange envelope