HL7 Validator

Find the field a receiver will choke on before you send the message. It is checked in your browser.

HL7 message

Validation result

Paste an HL7 v2 message on the leftabove and the check runs as you type.

What this HL7 validator checks

An interface engine that answers AE with "error in field" and nothing else is not much help at the end of a long day. This HL7 message validator reads the message the way a receiving system does and tells you which line and which field is wrong: PID-7 holds 31 February, MSH-11 is X, the ORU has no OBX. Errors are things a strict receiver rejects; warnings are things that usually work but deserve a second look.

It checks the structure first: segment IDs at the start of each line, the separators in MSH-1 and MSH-2, the required MSH fields, and whether the segments match what MSH-9 says (an ADT^A01 needs EVN, PID and PV1; an ACK needs MSA). Then it checks data types on every field our dictionary knows, using the HL7 v2.5.1 definitions: dates and timestamps (format and real calendar dates), numbers, set IDs and coded values. A few HL7 tables are checked as well, such as table 0103 for the processing ID and the order control codes in table 0119. It also checks that PID-3 and PID-5 are filled in, that MSH-9.3 names the structure HL7 gives the trigger event (an ADT^A04 is built as ADT_A01), and the order of the main segments in ADT, ORU and VXU messages: EVN and PID before PV1, each OBX after its OBR, and every ORC in a VXU followed by its RXA.

What it does not do is check your partner's conformance profile. Field lengths, which fields a particular interface makes required, and local code sets live in that spec, not in the standard, so a message can pass here and still be refused. For profile-based testing use a library such as HAPI HL7v2 or the NIST health IT test tools. The check runs in your browser; the message is not sent anywhere. If you want the fields as data instead, convert the message on the HL7 to JSON page and open the result in our JSON parser.

How to validate an HL7 message

1

Paste the message

Paste one message or a batch, upload a .hl7 or .txt file, or drop it on the editor. Sample loads a valid outpatient chest X-ray order (ORM^O01); Broken sample loads the same order with the kind of mistakes that turn up in real feeds.

2

Read the result

The right side shows the message type, version, control ID and the segments found, then every error and warning with its line and field. Click a line number to jump to it. For example, this header line:

MSH|^~\&|CPOE|LAKESHORE_CLINIC|RIS|LAKESHORE_IMAGING|2026-12-03 14:10||ORM|ORD-20261203-0092|X|2.5.1

gives the result below. The header is checked on its own here, so the missing ORC, PID and OBR are reported too:

MSH-7: Date/time of message: "2026-12-03 14:10" is not a valid date/time: it is written with dashes (ISO style); HL7 writes dates as digits only, YYYYMMDD.
MSH-11: Processing ID is "X", which is not in HL7 table 0103 processing ID (P, D, T, N, V).
MSH-9.2: MSH-9 has the message code ORM but no trigger event. Write it as code^event, for example ORM^O01.
MSH-9: This is ORM, which needs an ORC segment (common order), but there is none.
MSH-9: This is ORM without a PID segment. That is allowed by the standard but unusual.
MSH-9: This is ORM without an OBR segment. That is allowed by the standard but unusual.
3

Fix and check again

Edit the message in the left pane and the result updates as you type. Copy puts the whole report on your clipboard as plain text, ready for a ticket or an email to the sending team.

When an HL7 validator saves time

A rejected message in the error queue

Copy it out of the engine's error queue and paste it here. Most rejections come down to one of a handful of things: a date in the wrong format, an empty MSH-10, a segment ID in lower case, or a stray backslash from a Windows path in a comment.

Before a new interface goes live

Run the test messages from the sending system through the check before you hand them to the receiving team. It will not replace their profile testing, but it clears out the basic mistakes first.

Hand-written test messages

Writing an ORU or a SIU by hand for a unit test is easy to get slightly wrong. A missing trigger event or an OBX-2 value type of NUM instead of NM is caught here.

Explaining an ACK error to the sender

When a partner's message is refused, send them the copied report: it names the line, the field and the rule, using the codes from tables such as 0119 order control, which is quicker to act on than an AE with no text.

Frequently Asked Questions

What is the difference between an error and a warning?

An error is something the standard does not allow and a strict receiver will refuse: an empty MSH-9, a date that does not exist, a segment ID that is not three capitals or digits, a value outside an HL7-defined table, or a segment that may appear once appearing twice. A warning is legal but suspicious: an ORU with no OBX, a sex code that is not in the suggested list, a coded field holding a sentence, a line that starts with spaces.

Which HL7 versions does it understand?

Versions 2.1 to 2.9.1 in MSH-12 are accepted. Field names and data types come from v2.5.1, which covers what most feeds send. Older messages mostly use the same positions, so the checks still apply; where a field changed type between versions, the check follows v2.5.1.

Does it check Z-segments and segments it does not know?

It checks that their ID is valid and looks for stray escape characters, but it has no field list for them, so their values are not type-checked. The result lists those segments under "Not type-checked" so you know they were skipped.

Why is my date flagged when it looks fine?

HL7 dates are digits only: YYYYMMDD for a date, up to YYYYMMDDHHMMSS.SSSS plus an optional +/-ZZZZ time zone for a timestamp. Dashes, slashes, spaces and T separators are not allowed, and the date has to exist, so 20260230 fails. A field holding "" (two double quotes) means "delete this value" and is accepted.

Is my message uploaded?

No. The validator is part of this page and runs in your browser; the message is not sent to a server. Even so, use de-identified messages where you can. The HL7 anonymizer replaces names, IDs and addresses before you share one.

Can it check a whole batch file?

Yes. Paste or upload a file with several messages (with or without FHS/BHS headers) and each message is checked on its own. Control IDs used twice and a BTS-1 count that does not match the number of messages are reported too. A batch with headers and trailers but no MSH is accepted, with a note that it holds no messages. Files up to 2 MB are checked.

Related tools

Read the message field by field, tidy it up, or compare it with another one.