HL7 v2 Message Parser & Inspector

Parse raw HL7 v2.x messages into a readable table with field descriptions.

Save

Calculator

Inputs

Paste the full HL7 v2 message string (usually starts with MSH).

Live output

Results

Parsed Fields

Message Analysis

Total Fields120
Segments Found
MSH: 1PID: 1NK1: 1PV1: 1
FieldValueDescription
MSH (1)
MSH-1|Field Separator
MSH-2^~\&Encoding Characters
MSH-3EPICSending Application
MSH-4EPICADTSending Facility
MSH-5SMSReceiving Application
MSH-6SMSADTReceiving Facility
MSH-7199912271408Date/Time of Message
MSH-8CHARRIS
MSH-9ADT^A04Message Type
MSH-101817457Message Control ID
MSH-11DProcessing ID
MSH-122.5Version ID
PID (2)
PID-20493575^^^2^ID 1Patient ID
PID-3454721Patient Identifier List
PID-5DOE^JOHN^^^^Patient Name
PID-6DOE^JOHN^^^^
PID-719480203Date/Time of Birth
PID-8MAdministrative Sex
PID-10BRace
PID-11254 MYSTREET AVE^^MYTOWN^OH^44123^USAPatient Address
PID-13(216)123-4567Phone Number - Home
PID-16M
PID-17NON
PID-18 [1]400003403Patient Account Number
PID-18 [2]1129086Patient Account Number
NK1 (3)
NK1-2ROE^MARIE^^^^
NK1-3SPO
NK1-5(216)123-4567
NK1-7EC
PV1 (4)
PV1-2OPatient Class
PV1-3 [1]168 Assigned Patient Location
PV1-3 [2]219Assigned Patient Location
PV1-3 [3]CAssigned Patient Location
PV1-3 [4]PMA^^^^^^^^^Assigned Patient Location
PV1-7277^ALLEN MYLASTNAME^BONNIE^^^^Attending Doctor
PV1-192688684Visit Number
PV1-44199912271408Admit Date/Time
PV1-50002376853

Report

Export and share

Document

Copy and share

Assumptions

  • The parser expects a pipe-delimited HL7 v2-style message that begins with MSH and uses recognizable segment separators.
  • Field descriptions come from a built-in dictionary for common segments and do not cover every HL7 version, custom segment, or local implementation detail.
  • This viewer focuses on field-level structure and repetitions; it does not fully decode components, validate message grammar, or confirm trigger-event correctness.

Sensitivity preview

No numeric sensitivity scenarios are available.

Logic: Splits by \r (Segment) -> | (Field) -> ~ (Repetition).

Related Tools

View All

About this HL7 Message Viewer

HL7 v2 messages are compact and efficient for systems, but hard to read at a glance when you are troubleshooting field placement, missing separators, or repeating values. This viewer breaks a message into segments and fields, then adds common field descriptions so interface analysts can scan structure more quickly.

Who this calculator is for

  • Interface analysts, developers, and testers reading raw HL7 v2 messages during troubleshooting.
  • Teams mapping common segments such as MSH, PID, PV1, ORC, OBR, and OBX.
  • Anyone learning how field positions, repetitions, and separators appear in real HL7 traffic.

When to use it

  • Use it when you receive a raw HL7 v2 message and need a faster way to inspect fields and repetitions.
  • Use it to confirm where a value sits before building a transform, route, or parser.
  • Use it to compare common segment fields with a human-readable label while debugging test messages.

How to use this calculator

  1. Copy a raw HL7 message (e.g. `MSH|^~\&|...`).
  2. Paste it into the Raw Message input box.
  3. The tool automatically detects the segment separator (usually carriage return) and field separator (usually pipe).
  4. The Parsed Output table displays the Segment Name, Field Position, Value, and a Description (if available).

Key assumptions

  • The parser expects a pipe-delimited HL7 v2-style message that begins with MSH and uses recognizable segment separators.
  • Field descriptions come from a built-in dictionary for common segments and do not cover every HL7 version, custom segment, or local implementation detail.
  • This viewer focuses on field-level structure and repetitions; it does not fully decode components, validate message grammar, or confirm trigger-event correctness.

Accuracy and testing

Review formula sources, default test cases, assumptions, unit handling, rounding rules, and changelog for this calculator.

View accuracy page

How this calculator works

The parser reads the MSH segment to determine the encoding characters (Field Separator, Component Separator, etc.). It then splits the message into segments (lines) and fields. It references a built-in dictionary to provide human-readable names for common fields like `PID-5` (Patient Name) or `OBR-4` (Universal Service ID).
Splits by \r (Segment) -> | (Field) -> ~ (Repetition).

Inputs explained

Raw Message

The full HL7 string. It must contain at least an MSH segment. Standard separators are expected (e.g., `|` for fields, `^` for components).

Understanding your results

The output table organizes the message vertically. Field indicates the location (e.g., PID-3). Value is the data contained. Description explains what that data represents standardly.

Key Features

  • Local Processing (Privacy)
  • Standard Field Dictionary
  • Repetition Support (~)

Things to Keep in Mind

Supports standard v2.x pipe-delimited encoding. XML-encoded HL7 (v3) is not supported. Descriptions are provided for common segments (MSH, PID, PV1, ORC, OBR, OBX); custom Z-segments will appear without descriptions.

Tips & Best Practices

  • If your message is one long line, ensure there is a carriage return (`\r`) or newline (`\n`) between segments.
  • Always scrub real patient data (PHI) before pasting it into online tools, even though this tool runs locally in your browser.

Glossary of Terms

Segment
A line in the message starting with a 3-letter code (e.g., MSH, PID, OBR) representing a group of related data.
Field
A specific data element within a segment, separated by a delimiter (usually `|`).
Component
A sub-part of a field, separated by a caret (`^`).

Frequently Asked Questions

Is my patient data safe?
This viewer processes data in the browser and does not need a server round-trip, but you should still minimize or scrub real PHI before pasting live message content into troubleshooting tools.
What do the symbols mean (|, ^, ~)?
In HL7 v2, the pipe (|) separates fields, the caret (^) separates components (like parts of a name), and the tilde (~) indicates repeating fields. The ampersand (&) is used for sub-components.
Does this support FHIR or HL7 v3?
No. This tool is specifically designed for HL7 v2.x pipe-delimited messages. Use our specific FHIR or v3 Parsers for those formats.
Can I inspect multiple messages at once?
Yes, if you paste multiple messages separated by newlines (or carriage returns), the tool will attempt to parse them sequentially, though it works best with a single message at a time.
Why do some fields have no description?
The HL7 standard defines thousands of fields across different versions (2.3, 2.5, 2.7). We provide descriptions for the most common administrative and clinical fields, but obscure segments may not be mapped.