Free tool · HL7 v2

HL7 v2 message parser

Paste a message from any HL7 v2 interface and see it broken into segments, fields, repetitions and components, each named and explained, with dates and coded values made readable.

  • Messages never leave your browser
  • Escape sequences decoded
  • Copy the result as JSON
Fictional examples:
Message type
ORU^R01Unsolicited observation result
From → to
LIS @ CITYLAB→ HMIS @ CITYHOSP
Sent
2026-03-14 11:15:22
Version · control ID
v2.5.1LAB55021
Patient
JANE DOEID PAT102938
Segments
73 OBX results
MSHMessage Headerline 1

MSH|^~\&|LIS|CITYLAB|HMIS|CITYHOSP|20260314111522||ORU^R01^ORU_R01|LAB55021|P|2.5.1

FieldNameValue
MSH-1Field SeparatorST|
MSH-2Encoding CharactersST^~\&
MSH-3Sending ApplicationHDLIS
MSH-4Sending FacilityHDCITYLAB
MSH-5Receiving ApplicationHDHMIS
MSH-6Receiving FacilityHDCITYHOSP
MSH-7Date/Time of MessageTS202603141115222026-03-14 11:15:22
MSH-9Message TypeMSGORU^R01^ORU_R01
Message Code
ORU
Trigger Event
R01
Message Structure
ORU_R01
MSH-10Message Control IDSTLAB55021
MSH-11Processing IDPTPProduction
MSH-12Version IDVID2.5.1
PIDPatient Identificationline 2

PID|1||PAT102938^^^CITYHOSP^MR||DOE^JANE||19870522|F

FieldNameValue
PID-1Set IDSI1
PID-3Patient Identifier ListCXPAT102938^^^CITYHOSP^MR
ID Number
PAT102938
Assigning Authority
CITYHOSP
Identifier Type Code
MR
PID-5Patient NameXPNDOE^JANE
Family Name
DOE
Given Name
JANE
PID-7Date/Time of BirthTS198705221987-05-22
PID-8Administrative SexISFFemale
OBRObservation Requestline 3

OBR|1|ORD7781|S12345|CBC^Complete blood count^L|||20260314083000|||||||20260314084512||4521^DEMO^DOCTOR|||||||20260314111500||HM|F

FieldNameValue
OBR-1Set IDSI1
OBR-2Placer Order NumberEIORD7781
OBR-3Filler Order NumberEIS12345
OBR-4Universal Service IdentifierCECBC^Complete blood count^L
Identifier
CBC
Text
Complete blood count
Coding System
L
OBR-7Observation Date/TimeTS202603140830002026-03-14 08:30:00
OBR-14Specimen Received Date/TimeTS202603140845122026-03-14 08:45:12
OBR-16Ordering ProviderXCN4521^DEMO^DOCTOR
ID Number
4521
Family Name
DEMO
Given Name
DOCTOR
OBR-23Charge to PracticeMOC20260314111500
OBR-25Result StatusIDHM
OBR-26Parent ResultPRLF
OBXObservation / Resultline 4

OBX|1|NM|HGB^Hemoglobin^L||10.8|g/dL|12.0-15.5|L|||F|||20260314110900

FieldNameValue
OBX-1Set IDSI1
OBX-2Value TypeIDNMNumeric
OBX-3Observation IdentifierCEHGB^Hemoglobin^L
Identifier
HGB
Text
Hemoglobin
Coding System
L
OBX-5Observation ValueNM10.8
OBX-6UnitsCEg/dL
OBX-7Reference RangeST12.0-15.5
OBX-8Abnormal FlagsISLBelow low normal
OBX-11Observation Result StatusIDFFinal
OBX-14Date/Time of the ObservationTS202603141109002026-03-14 11:09:00
OBXObservation / Resultline 5

OBX|2|NM|WBC^White blood cells^L||7.4|10*3/uL|4.5-11.0|N|||F|||20260314110900

FieldNameValue
OBX-1Set IDSI2
OBX-2Value TypeIDNMNumeric
OBX-3Observation IdentifierCEWBC^White blood cells^L
Identifier
WBC
Text
White blood cells
Coding System
L
OBX-5Observation ValueNM7.4
OBX-6UnitsCE10*3/uL
OBX-7Reference RangeST4.5-11.0
OBX-8Abnormal FlagsISNNormal
OBX-11Observation Result StatusIDFFinal
OBX-14Date/Time of the ObservationTS202603141109002026-03-14 11:09:00
OBXObservation / Resultline 6

OBX|3|NM|PLT^Platelets^L||512|10*3/uL|150-400|H|||F|||20260314110900

FieldNameValue
OBX-1Set IDSI3
OBX-2Value TypeIDNMNumeric
OBX-3Observation IdentifierCEPLT^Platelets^L
Identifier
PLT
Text
Platelets
Coding System
L
OBX-5Observation ValueNM512
OBX-6UnitsCE10*3/uL
OBX-7Reference RangeST150-400
OBX-8Abnormal FlagsISHAbove high normal
OBX-11Observation Result StatusIDFFinal
OBX-14Date/Time of the ObservationTS202603141109002026-03-14 11:09:00
NTENotes and Commentsline 7

NTE|1|L|Platelet count confirmed by smear review.

FieldNameValue
NTE-1Set IDSI1
NTE-2Source of CommentIDLAncillary (filler)
NTE-3CommentFTPlatelet count confirmed by smear review.

How an HL7 v2 message is built

An HL7 v2 message is a list of segments, one per line, each starting with a three-letter name. The first is always MSH, the message header, which says who sent the message, to whom, when, and what it is: MSH-9 holds the message type and trigger event, such as ADT^A01 for an admission or ORU^R01 for a lab result.

Each segment is split into numbered fields by |. A field such as PID-5 (patient name) can have components separated by ^ (family name, given name, middle name…), repeat with ~, and split further into subcomponents with &. Field numbers in MSH are offset by one because the field separator itself counts as MSH-1.

Common messages and segments

  • ADT (admit, discharge, transfer): PID for the patient, PV1 for the visit, NK1 for next of kin, AL1 for allergies.
  • ORM / OML (orders): ORC for the order and OBR for the test or procedure requested.
  • ORU (results): OBR for the order the results answer, then one OBX per result, with the value, units, reference range and abnormal flag.
  • ACK (acknowledgment): MSA-1 says whether the receiver accepted (AA), rejected (AR) or errored on (AE) the message.

Frequently asked questions

Is the HL7 message sent to a server?

No. Parsing happens in your browser, and nothing you paste is uploaded or stored. Only paste data you are allowed to handle, and prefer test messages over live patient data.

Which HL7 versions and messages does it support?

Any HL7 v2.x message (2.1 to 2.9). Field and component names follow v2.5.1 for the common segments: MSH, EVN, PID, PD1, NK1, PV1, PV2, ORC, OBR, OBX, NTE, AL1, DG1, PR1, MSA, ERR, MRG, SPM, IN1, GT1, TXA, SCH, RXA and SFT. Other segments, including site-specific Z-segments, are still split into fields and components, just without names.

My message is on one line, or has MLLP characters. Will it parse?

Segments can be separated by CR, LF or CRLF, and the MLLP start and end characters (VT, FS) are removed. If everything is on a single line, put each segment (MSH, PID, PV1…) on its own line first.

What are the ^ ~ \ & characters?

They are the encoding characters defined in MSH-2. | separates fields, ^ separates components, ~ separates repetitions of a field, \ starts an escape sequence and & separates subcomponents. A message may define its own, and the parser reads them from MSH.

Does it validate the message?

It checks the basics an interface engine rejects most often: the message starts with MSH, segment names are valid, and MSH-9 (message type), MSH-10 (control ID) and MSH-12 (version) are present. It does not validate against a full message profile.