Free DICOM test files and sample generator

The standard every scanner, PACS and radiology viewer uses. A DICOM file pairs the image with a long list of tagged attributes describing the patient, study and equipment. Generate valid .dcm sample files to test viewers, importers and anonymisation tools.

Generate a .dcm file →

What is a .dcm file?

DICOM: Medical Imaging File. DICOM is the standard every scanner, PACS and radiology viewer speaks, and its shape surprises people: the image is the small part. A file is mostly a long list of tagged attributes, patient, study, series, equipment, acquisition geometry, with the pixels as one more attribute at the end. Two rules govern the encoding and both are easy to get wrong: every value must have an even length, and elements must appear in ascending tag order. The declared Rows and Columns must also agree exactly with the length of the pixel data, which is the single most common inconsistency in hand-made DICOM files.

Why generate a test DICOM file?

What you can put inside a .dcm file

You get 3 content options for DICOM, so the file holds something meaningful rather than random padding: Gradient, Solid color, Checkerboard. For DICOM these are alternatives, so choose the one that matches what you need to test.

How a .dcm file is identified

Every .dcm file begins at offset 128 with 44 49 43 4D, "DICM" at offset 128, after a 128-byte preamble that exists for compatibility with older software. That is what a validator inspecting content rather than the file name looks for.

How the size lands on the exact byte

A private data element in an odd group, reserved by the standard for vendor use and skipped by readers, carries the padding. Every DICOM value has an even length by rule, so a DICOM file can never be an odd number of bytes.

Negative testing with broken DICOM files

Which failure to reach for, and what to assert for each, is covered in how to make a corrupted file for testing. For upload limits and type checks see testing file upload validation.

Sample DICOM content

[DICOM], 128-byte preamble + "DICM" + explicit-VR data elements + pixel data.

This shows the shape of the file. Your download is generated fresh at the size you choose, so the values will differ.

How to open and verify the file

Open it in any DICOM viewer, Weasis, Horos, RadiAnt, MicroDicom, or read the tags with `dcmdump` from DCMTK, or `pydicom` in Python. Files here are 8-bit MONOCHROME2 secondary-capture images in Explicit VR Little Endian, the most widely supported encoding, with the size carried by the row count. All patient details are synthetic and obviously so: the name is literally "Test^Patient". Nothing here resembles a real record, and no real record was involved in producing it.

Media type application/dicom · extension .dcm · category Images

Generate a .dcm file → · questions about sizes, privacy or cost are answered on the site FAQ.

Frequently asked questions about DICOM files

What identifies a .dcm file?

A .dcm file begins at offset 128 with the bytes 44 49 43 4D, "DICM" at offset 128, after a 128-byte preamble that exists for compatibility with older software. Those bytes are what a content-sniffing validator looks for, and what the Corrupted condition destroys.

How can a .dcm file be an exact number of bytes?

A private data element in an odd group, reserved by the standard for vendor use and skipped by readers, carries the padding. Every DICOM value has an even length by rule, so a DICOM file can never be an odd number of bytes.

What can go inside the DICOM file?

There are 3 content options for .dcm: Gradient, Solid color, Checkerboard. For DICOM these are alternatives, so pick the one matching what you need to test.

Can I download several broken DICOM files at once?

Yes, select more than one File Condition and you get one ZIP containing a .dcm per condition, each named after its condition.

Can the DICOM file use UTF-16 or a byte-order mark?

No, and deliberately. A .dcm file is a container rather than plain text, so rewriting its bytes as UTF-16 would not produce a UTF-16 document. It would produce a broken file. Use a text format such as CSV, JSON or XML for encoding tests.

How do I open or verify the DICOM file?

Open it in any DICOM viewer, Weasis, Horos, RadiAnt, MicroDicom, or read the tags with dcmdump from DCMTK, or pydicom in Python. Files here are 8-bit MONOCHROME2 secondary-capture images in Explicit VR Little Endian, the most widely supported encoding, with the size carried by the row count. All patient details are synthetic and obviously so: the name is literally "Test^Patient". Nothing here resembles a real record, and no real record was involved in producing it.

Related Images formats

JPG · PNG · GIF · SVG · WEBP · BMP · TIFF · ICO

Browse all file formats →