Privacy reminder. Do not paste real patient data, credentials, secrets, production identifiers, or confidential messages. Use synthetic/test HL7 only.
Comparison
Paste two HL7 messages
The comparison runs locally in your browser. Repeating segments such as OBX, AL1, DG1, NK1, IN1, and NTE are matched using useful identifiers where available instead of line position alone.
Baseline or before version.
Changed or after version.
No comparison runPaste two HL7 messages and click Compare messages.
Status
Segment
Path
Original
Updated
A differences-only report will appear here.
FAQ
HL7 comparison questions
How are repeating segments matched?
The tool uses identifiers appropriate to common segments, such as the observation identifier for OBX, allergen for AL1, diagnosis code for DG1, and order numbers for ORC and OBR. It falls back to occurrence order when no reliable identifier is present.
Why are MSH.7 and MSH.10 ignored by default?
Message timestamps and control IDs commonly change between otherwise equivalent messages. You can include them by clearing the options.
Is this a certified HL7 validator?
No. It is a practical comparison utility for development, testing, troubleshooting, and documentation.
Can I paste real patient data?
No. Use synthetic, anonymised, or test data only.
Practical guide
Compare HL7 messages without losing field context
The diff tool is intended for mapping regression tests, environment comparisons, interface upgrades, and investigating why one message is accepted while another fails. It breaks changes down by segment and HL7 field location rather than presenting only a character-level text diff.
Recommended workflow
Choose messages representing the same event or test scenario.
Confirm both messages use compatible delimiter definitions from MSH.
Review MSH differences first, especially message type, control ID, processing ID, version, and acknowledgement settings.
Inspect changed clinical or administrative fields by segment, repetition, component, and subcomponent.
Decide which differences are expected dynamic values and which indicate mapping or configuration drift.
High-value comparisons
Before and after a transformer or mapping change.
A production-like synthetic sample versus the vendor's accepted test sample.
Messages generated by two versions of an interface.
An accepted message versus one that produced an AE, AR, CE, or CR acknowledgement.
Payloads from two sites where local code or identifier configuration differs.
Only PV1-3.4, the facility component, changed. A text diff may make this look minor, but a downstream route could use the facility to choose a destination, document template, ward mapping, or tenant. Field-level context helps reviewers assess operational impact.
The same principle applies to identifier assigning authorities, code systems, observation units, and provider namespaces: a component change can matter more than a visibly larger free-text change.
Avoiding noisy comparisons
Stabilise dynamic values where possible
Timestamps, IDs, and repetitions
MSH-7 timestamps, MSH-10 control IDs, visit numbers, order numbers, and generated identifiers commonly differ on every run. Repeating OBX, AL1, DG1, or NTE segments may also be reordered or inserted, shifting later positions.
Use fixed synthetic values in regression fixtures when the purpose is to verify a mapping rather than generation behaviour. Then reintroduce dynamic values as separate tests.
Limitations
The tool cannot determine whether two different codes are clinically or operationally equivalent.
Segment matching becomes less certain when repeated segments lack stable identifiers.
It does not execute a message profile or receiving-system validation rules.
Whitespace and line-ending normalization can hide transport-level differences; use the MLLP inspector when framing is relevant.
Related guides
Continue with the underlying concepts
Use these guides when the tool exposes a structure or error that needs a standards-level explanation.
HL7 v2
HL7 v2 Delimiters and Escape Sequences
Understand MSH-1, MSH-2, non-default separators and escaped data that breaks field parsing.
Practical guidance backed by integration experience
Maintained and technically reviewed by Health Data Tools, drawing on more than 15 years of healthcare integration experience across HL7, FHIR, CDA, APIs, PKI, and clinical integration systems.
These references support the technical context. Local implementation guides, vendor profiles, and receiving-system rules still take precedence for a specific interface.