Reference·MSH Segment·MSH-1
HL7 v2 Reference

HL7 v2 MSH-1 (Field Separator): Format, Values, and Testing Notes

Jul 27, 2026 · 4 min read
MSH-2 →

MSH-1 is the one field in HL7 v2 that does not have a delimiter in front of it — it is the character immediately after the literal letters MSH, and it defines what a delimiter even looks like for the rest of the message.

Quick answer

MSH-1 is the single character immediately following "MSH" at the start of every HL7 v2 message — it declares the field separator, almost always a pipe (|), that the rest of the message uses to divide fields.

What this field contains

|
The near-universal choice — used in the overwhelming majority of real-world messages
other characters
Technically legal per the standard, but rare and a frequent source of interoperability issues

Example

Synthetic example Generated by Synthibase
MSH|^~\&|ADTSYS|HOSP|BILLSYS|HOSP|20260727143000||ADT^A01|MSG00001458|P|2.5.1

The character right after MSH — here, | — is MSH-1 itself, defining the field separator for the whole message. Synthetic message — not a real transmission.

Where this trips people up

Because MSH-1 defines the very delimiter used to read the rest of the segment, a parser has to read this one character positionally before it can tokenize anything else. Code that hardcodes a pipe instead of reading MSH-1 dynamically will work against every partner until one sends a nonstandard separator, at which point the entire message misparses from the very first field onward rather than failing on just one value.

HL7 v2 MSH Explained: Structure, Fields, and Common Mistakes
How to Write EDI Test Cases That Actually Catch Go-Live Failures
Healthcare Data Interoperability: A Practical Explainer for IT Leaders
Test against nonstandard delimiters before go-live
Synthibase generates synthetic HL7 messages you can use to verify your parser reads MSH-1 and MSH-2 dynamically instead of assuming a pipe.
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.