HL7 Anonymizer
Make a message safe to paste into a ticket or a test suite. It is a helper: read the result before you share it.
HL7 message
Anonymized HL7
Paste your HL7 message on the leftabove and the result shows up here.
Or drop a file on this box, , or .
What was changed
This page replaces the fields listed in the FAQ below. Read the result before you share it: comments, Z-segments and unusual fields can still hold personal details.
| Line | Field | Name | Was | Now |
|---|
Nothing was replaced. The fields this page handles are empty in this message.
De-identify an HL7 message without breaking it
Sooner or later someone needs a real message to reproduce a bug, and the real message has a real patient in it. Blanking the fields by hand is slow, and the result often stops reproducing the bug because PID-3 is now empty or the dates no longer line up. This HL7 anonymizer replaces identifying values with made-up ones of the same shape and leaves the structure alone: same segments, same field positions, same separators, so the message still parses the way the original did.
The same real value always gets the same fake. If the patient's surname appears in PID-5, NK1-2 and IN1-16, all three become one new surname, and an MRN that is mentioned in an NTE comment is swapped for the same fake MRN. IDs keep their length and pattern, SSN-shaped values get a 9 in front (numbers in the 900 range are never issued as Social Security numbers), phone numbers end in 555-01xx, a range kept for fictional telephone numbers, and e-mail addresses move to example.org, which RFC 2606 reserves for examples. Fakes are drawn at random, not computed from the real value, so they cannot be worked back to the original.
Be clear about what this is: a helper that does the tedious part, not a guarantee. Replacing direct identifiers is one step of de-identification; written notes, Z-segments and rare fields can still say who the patient is, and whether a message is safe to share is your organization's call. Everything runs in your browser and the message is not uploaded. For test data you want to query, convert the result with HL7 to JSON and load it into the online JSON parser.
How to anonymize an HL7 message
Paste the message
Paste one message or a batch, upload a file or drop it on the tool. Sample loads a registration (ADT^A04) with next of kin, insurance, a guarantor and a note that names the patient.
Choose how dates are handled
Shift all dates moves every date in the message by the same number of days, so the gaps between admission, results and discharge stay right. The page picks a random number each time it loads; keep it to yourself or type your own. Birth dates: year only keeps just the year of birth and death dates, also where the same date is copied into another field, and leaves the other dates. The shift is a whole number of days from -3650 to 3650; an empty box counts as 0, and the status line shows the number actually used. With a shift of -30 days, this line:
PID|1||00561238^^^MAPLEWOOD^MR||Haverford^Lucinda^J^^Ms||19710305|F becomes something like this (the fakes differ each time the page loads):
PID|1||00117452^^^MAPLEWOOD^MR||Iversen^Juno^A^^Ms||19710203|F Check the list, then copy
Under the output, every replaced value is listed with its line and field, the old value masked (H••••••••) and the new one. Notes point out what was not handled, such as Z-segments. Copy and Download keep the line ends of the text you pasted or uploaded (CR, LF or CR LF), and the status line says which.
When an HL7 anonymizer helps
Attaching a message to a vendor ticket
The vendor needs the exact message that failed. Anonymize it first; the separators, segment order and field positions stay as they were, so the bug usually still reproduces.
Building a test suite from production traffic
Real messages cover the odd cases that hand-written ones miss. Run each one through here and keep the result as a fixture. With Shift all dates, the timing between the dates inside a message is kept.
Training and documentation
Screenshots and examples in an interface spec look better with realistic data. Fake names, example.org addresses and 555 numbers look real without belonging to anyone.
Sharing a message in a forum or chat
Before posting a message to ask why the engine rejects it, strip the identifiers and turn on Remove notes, so the clinical notes do not travel with it.
Frequently Asked Questions
Which fields are replaced?
Every name (XPN), identifier (CX), address (XAD) and phone or e-mail (XTN) field in PID, PD1, NK1, GT1, IN1, IN2, IN3, MRG, PV1, PV2, CTD, ACC, DB1 and PDA, wherever it sits in the segment. On top of those: birth and death dates, SSNs (PID-19, NK1-37, GT1-12, IN2-2), the Medicare, Medicaid and military numbers in IN2, policy and group numbers in IN1, employers, birth places, the county code in PID-12 and in addresses, and the accident location in ACC. The insurance company itself (IN1-3 to IN1-7 and IN1-9) is kept. With Provider names on, every doctor and staff field (XCN) in any segment is replaced too, along with staff and facility addresses and phones such as ORC-22 to ORC-24, OBX-24, ROL, PRD and PRT.
Does this make the message HIPAA compliant?
No page can promise that, and this one does not try. It replaces the direct identifiers listed above. Whether the result is de-identified enough for your purpose depends on the rest of the message and on your organization's rules, so have someone responsible look at it before it leaves your hands.
What happens to notes and Z-segments?
Names and IDs that were replaced elsewhere are also swapped where they appear in other fields, including NTE comments and Z-segments. Anything else written in a note, such as "her brother Tom called", is not detected. Remove notes replaces NTE-3 and TX/FT results in OBX-5 with a short note. Z-segments are listed in the notes so you can check them by hand.
Why do I get the same fake values when I edit the message?
Fakes are remembered while the page is open, so changing one field does not reshuffle the rest and two messages anonymized one after the other stay consistent with each other. Press New fakes to draw a fresh set. The fakes live only in the page's memory and are gone when you reload or close it.
Can the fake values be reversed?
Not from the output. Each fake is picked at random the first time a real value is seen and kept only in the page's memory. That makes the output pseudonymized data with no key kept anywhere. A date shift, on the other hand, is one number: anyone who learns it can shift the dates back, which is why the page picks a random one.
What about lines that are not segments?
They are left out of the output, because a broken line is often the wrapped end of a PID or NK1 segment and would otherwise slip through unchanged. That includes a line that starts like a segment but with three letters HL7 does not define, such as HMO|.... The notes list their line numbers. If you want them kept, repair the message with the HL7 formatter first and anonymize the result.
Related tools
Clean up the message first, check it, or compare it with the original.