Skip to content
Healthcare data guides

How to use a FHIR validator for JSON and convert FHIR JSON to XML

Published 2 min read

A FHIR resource that looks fine can still have a misspelled element, a wrong data type or a broken reference. A FHIR validator finds those problems quickly. Convertada's FHIR JSON Validator checks your FHIR R4 JSON in your browser, and the FHIR JSON to XML Converter turns valid JSON into FHIR XML.

Use test data only

The tools run in your browser and do not store or send your data. Still, use synthetic or de-identified examples unless you are authorised to handle real data and your device and network are secure. No claim of HIPAA, GDPR or other regulatory compliance is made.

What the validator checks

It checks structure against the official FHIR R4 JSON Schema:

  • Element names and data types
  • Formats
  • Required elements
  • Fixed code lists
  • Bundle rules and references between resources

It reports the resource type, the FHIR version and the number of resources checked, then lists the findings with a severity (error, warning or note), a location, a message and a suggested correction.

What it does not check

This is structural validation. It does not check profiles, invariants or external terminology. A resource can pass here and still fail a local profile or an implementation guide. For those, you need a profile-aware validator and the guide your project follows.

Step-by-step: validate FHIR JSON

  1. Open the FHIR JSON Validator.
  2. Paste your JSON, drop a file (up to 5 MB) or load an example.
  3. Run the validator.
  4. Read the counts of errors, warnings and notes, then the table of findings.
  5. Fix the problems in your source, one at a time, starting with the first error. A single mistake can cause several messages.
  6. Validate again until the result is clean.

Convert FHIR JSON to XML

  1. Open the FHIR JSON to XML Converter.
  2. Paste valid FHIR R4 JSON.
  3. Convert and copy or download the XML.

XML is only produced for structurally valid FHIR. If your JSON has errors, the tool shows "XML not produced", explains why and lists the errors to fix first. That is intentional: invalid input would create misleading XML.

Practical examples

A Patient resource with a typo in an element name. The validator points to the location of the unknown element.

A Bundle with a broken reference. The reference check shows which entry points to something that is not in the bundle.

An invalid date format. The finding names the field and suggests the expected format.

Common problems and how to fix them

"Invalid JSON". Check for trailing commas, missing quotes or brackets.

Too many errors at once. Start from the first one. Later errors are often caused by it.

Everything passes but the receiving system rejects it. The receiver may enforce a profile or terminology rules that structural validation does not cover.

Frequently asked questions

Which FHIR version is supported?

FHIR R4.

Is my data uploaded?

No. It is validated in your browser. Use test data anyway.

Does it validate profiles?

No. It does not validate profiles, invariants or external terminology.

Can I convert HL7 v2 messages too?

Yes, see how to convert HL7 to FHIR.

Conclusion

Validate early, fix errors from the top and only convert to XML once the JSON is valid. Treat a clean result as a good first check, not as final approval.