Understanding DICOM UIDs
- A DICOM UID is a dot-separated numeric string made of an organization root and a suffix.
- DICOM UIDs can be up to 64 characters, use only digits and periods, and disallow leading zeros in components.
- Study Instance UID, Series Instance UID, and SOP Instance UID together bind the Patient-Study-Series-Instance hierarchy.
- UUID-derived UIDs under root 2.25 let software generate collision-free identifiers without registering an organization root.
- Systems should treat duplicate SOP Instance UIDs as idempotent writes since senders may retry transfers.
A DICOM Unique Identifier (UID) is a dot-separated numeric string that identifies an entity in medical imaging without ambiguity. Every imaging study, image series, individual slice, and clinical transfer syntax carries a UID.
Because healthcare operates across thousands of independent hospitals, clinics, and equipment vendors, no central authority coordinates these identifiers. Instead, DICOM relies on a distributed naming hierarchy rooted in international standards. When your system receives an imaging instance, its UID is guaranteed to be globally unique across all medical institutions worldwide.
The DICOM Standard Part 5 (PS3.5, Chapter 9) defines the structure and strict encoding rules for all DICOM UIDs.
Structure of a DICOM UID
Every DICOM UID consists of two parts separated by a dot: an organization root and a suffix.
$$\text{UID} = \langle\text{org root}\rangle.\langle\text{suffix}\rangle$$
An example SOP Instance UID looks like this:
1.2.840.113619.2.55.3.604688319.876.1694412345.123
\_________________/ \____________________________/
org root suffix
The organization root identifies the company, hospital, or standards body responsible for creating the identifier. Organizations obtain this root from an official registration authority under international standards.
The suffix is generated by the organization’s software or equipment. The organization must ensure that every suffix it creates is unique within its assigned root.
The standard reserves the root 1.2.840.10008 exclusively for official DICOM definitions. Transfer syntaxes, standard storage classes, and standard application contexts always use this prefix. Custom software and private instances must never generate identifiers under this root.
Technical encoding rules and constraints
DICOM UIDs follow rigid formatting rules. Violating any of these constraints creates an invalid DICOM dataset that compliant archives will reject:
- Character set: A UID contains only numeric digits (
0–9) and period separators (.). It never contains letters, hyphens, or underscores. - Maximum length: A UID cannot exceed 64 characters, including all digits, separators, and any optional trailing null padding byte.
- No leading zeros: A component between dots cannot start with zero unless the component is exactly the single digit
0. For example,.01.is illegal and must be written as.1., while.0.is completely valid. - Even length padding: In serialized datasets, data elements must align on 16-bit boundaries. If a UID string has an odd byte length, the encoder appends a single trailing null byte (
0x00) to reach an even length. In memory, JSON, and network handshakes, strings omit this null byte.
For the formal specification of these rules, see DICOM PS3.5 Chapter 9.
The UID hierarchy: Study, Series, and Instance
In clinical workflows, DICOM groups imaging into a strict four-level tree: Patient, Study, Series, and Instance. To see how these levels map to clinical encounters and imaging sequences, read our guide on DICOM Instances, Series, and Studies explained.
Three primary UIDs bind this hierarchy together:
| Identifier | DICOM Tag | Scope and Purpose |
|---|---|---|
| Study Instance UID | (0020,000D) |
Uniquely identifies an entire examination encounter. All series and images within that exam share this value. |
| Series Instance UID | (0020,000E) |
Uniquely identifies a single acquisition run, sequence, or reconstruction inside a study. |
| SOP Instance UID | (0008,0018) |
Uniquely identifies an individual object, such as a single 2D image slice, a waveform, or a report. |
Each DICOM file is an instance. It embeds its own SOPInstanceUID alongside its parent StudyInstanceUID and SeriesInstanceUID.
When your application receives a stream of files, it does not need a separate manifest or folder structure. Your ingest pipeline reads these three tags and reconstructs the full hierarchy in memory.
How to generate valid UIDs in your software
If your software creates new DICOM instances, splits series, or creates secondary captures, you must generate new UIDs. Senders must never reuse existing UIDs for modified content.
Software teams have two valid approaches to generate UIDs.
1. Register an official ISO organization root
The traditional method uses an official ISO Object Identifier (OID) root. An organization applies to a national standards body (such as ANSI in the United States or BSI in the United Kingdom).
Once assigned, the organization appends internal sub-branches for different systems, products, and sequences:
1.2.826.0.1.3680043.2.135.738.1.20260924083012.1
The registration process and hierarchy rules are defined in DICOM PS3.5 Annex C.
2. Generate UUID-derived UIDs using root 2.25
Obtaining a registered enterprise OID takes time and administrative overhead. For many software projects and cloud services, the DICOM standard provides an immediate alternative: UUID-derived UIDs.
Under DICOM PS3.5 Section B.2 and ITU-T Recommendation X.667, you can generate a standard 128-bit UUID (version 4) and convert it into a valid UID under root 2.25.
The algorithm works as follows:
- Generate a random version 4 UUID (128 bits).
- Interpret the 128-bit value as a single unsigned decimal integer.
- Prefix the decimal number with
2.25..
A 128-bit integer produces up to 39 decimal digits. With the prefix 2.25., the total string length is at most 44 characters. This leaves 20 characters of headroom under DICOM’s 64-character limit.
Here is an example in TypeScript:
import { randomUUID } from 'node:crypto';
export function generateDicomUid(): string {
const hex = randomUUID().replace(/-/g, '');
const decimal = BigInt(`0x${hex}`).toString(10);
return `2.25.${decimal}`;
}
This method gives you collision-free identifiers without registering an enterprise root or maintaining counter state across servers.
Critical mistakes when handling DICOM UIDs
Software teams new to medical imaging frequently make four mistakes when storing or processing UIDs:
1. Treating UIDs as hierarchical paths or parsing their contents
Many developers notice that an organization root contains recognizable components (like timestamps or scanner model numbers) and attempt to parse metadata out of the UID string.
DICOM PS3.5 Section 9 explicitly prohibits this practice. UIDs are opaque identifiers. You must never parse components to extract dates, model numbers, or study relationships. Senders can alter suffix schemes at any time without notice.
2. Deriving new UIDs by appending suffixes to incoming UIDs
When post-processing an image, some applications create a new identifier by appending a number to the original UID (such as originalUID + ".1").
Never build a UID by appending digits to an identifier generated by another vendor. If the original UID was 62 characters long, appending .1 exceeds the 64-character limit. More importantly, you do not own the parent root, which risks collisions with that vendor’s future objects. Always generate a brand new UID under your own root or using root 2.25.
3. Case-sensitive or trailing-character comparison bugs
A UID contains only digits and dots. However, strings stored in local indices or received over HTTP can carry hidden whitespace or null bytes.
In serialized files, UIDs with odd lengths end with a 0x00 null byte. If your parser retains that byte, string comparisons against clean inputs will fail. Always strip trailing null bytes and whitespace before indexing or comparing UIDs.
4. Overwriting data on duplicate SOP Instance UIDs
Hospital modalities retry transfers when network connections drop. Senders often transmit the exact same slice twice across separate sessions.
Both transfers carry the identical SOPInstanceUID. If your system treats an incoming instance as a novel object, it may duplicate storage records or trigger repeated downstream events. Design your storage ingestion to treat SOPInstanceUID writes as idempotent operations.
UIDs in network negotiation and transfers
UIDs do not just label stored images; they control live network connections.
When a modality connects to an endpoint over DIMSE, it negotiates SOP classes and transfer syntaxes using standardized UIDs. For an explanation of how systems agree on supported image formats, see our article on DICOM SOP Classes and Transfer Syntaxes explained. To understand how devices verify connectivity before moving studies, read our guide to DICOM C-ECHO testing.
If you are receiving studies from hospital scanners across the internet, you can stream them directly to cloud endpoints using standard protocols. See our guide on receiving DICOM deliveries and learn how to connect a DICOM sender to your destination.
Dicomly builds infrastructure for healthcare software teams that receive DICOM studies from hospitals. Why we built Dicomly →