FHIR Resource Diff

Compare FHIR resources side-by-side with structural diffing. Spot changes instantly, all in-browser.

  • Compare two FHIR resources and see added, removed, and changed elements.
  • Useful for regression testing and reviewing server round-trips.

How to compare two FHIR resources

  1. Paste the original resource on the left and the modified one on the right.
  2. The comparison runs automatically and lists every added, removed and changed element, with its path (for example name[0].given[1]) and the old and new values.
  3. Leave Ignore metadata on to skip meta.lastUpdated and meta.versionId, which change on every save and would otherwise hide the real differences.

Both resources stay in your browser.

Typical uses

  • Server round-trips. POST a resource, GET it back, and compare. Servers often add meta, normalize dates, drop unknown elements or reorder arrays, and the diff shows exactly what they did.
  • Mapping regressions. Compare the output of your CSV-to-FHIR or HL7 v2-to-FHIR mapping before and after a code change.
  • Version history. Compare two versions from _history to see what an update changed.
  • Reviewing test fixtures before committing changes to them.

Worked example

Original:

{
  "resourceType": "Patient",
  "id": "example",
  "meta": { "versionId": "1" },
  "name": [{ "family": "Shaw", "given": ["Amy"] }],
  "telecom": [{ "system": "phone", "value": "+1-555-0100" }],
  "gender": "female"
}

Modified:

{
  "resourceType": "Patient",
  "id": "example",
  "meta": { "versionId": "2" },
  "name": [{ "family": "Shaw", "given": ["Amy", "V."] }],
  "gender": "female",
  "birthDate": "1987-02-20"
}

With Ignore metadata on, the diff reports three changes: name[0].given[1] added ("V."), telecom removed, and birthDate added. The versionId change is skipped.

How arrays are compared

Arrays are compared by position: item 0 against item 0, item 1 against item 1. That matches how FHIR treats order (it can be meaningful, for example the first name), but it means that if a server reorders an array, or an item is inserted at the start, every following item shows up as changed. When that happens, look at the values: the same values at shifted positions mean a reorder, not a data change.

Limitations

  • The comparison is structural JSON comparison. It doesn't know FHIR semantics, so "2026-03-05T10:00:00Z" and "2026-03-05T05:00:00-05:00" (the same instant) are reported as different, and so are equivalent codes with different display text.
  • Only meta.lastUpdated and meta.versionId are ignored. Other server-added fields, such as meta.source or a generated narrative text, appear as differences.
  • It compares two resources at a time. To compare a resource's definition across FHIR versions instead, use the R4 vs R5 comparison.

FAQ

Can I compare two Bundles?

Yes, any two JSON documents can be compared. For Bundles, the position-based array comparison means entries need to be in the same order for a useful result. Sort both by fullUrl or resource id first if they aren't.

Is anything sent to a server?

No. Both inputs are parsed and compared in this page.

Which FHIR versions can I compare?

Any version, as long as both sides use the same one. Comparing an R4 resource with an R5 one reports every renamed element as removed and added. To see version differences in the definitions themselves, use the R4 vs R5 comparison.

Can I ignore other fields, such as narrative text?

Not yet. Only meta.lastUpdated and meta.versionId can be ignored. Remove other fields from both sides before comparing if they're noise for you.

FHIR Toolbox is a free collection of HL7 FHIR tools by Omindra Labs. The tools process your data in your browser; it is not uploaded for normal tool operations.