DICOM Value Representations (VR) explained

  • A Value Representation defines the data type, encoding, and byte length rules for a DICOM data element.
  • The DICOM standard defines 34 distinct Value Representations grouped into text, numeric, binary, and sequence types.
  • DICOM requires an even number of bytes per element, padding odd-length values with a null byte or space character.
  • Value Multiplicity lets one data element hold multiple values, separated by backslashes for string-based VRs.
  • Using the wrong VR can silently corrupt data, such as truncating numeric strings or misreading length headers.

In DICOM, a Value Representation (VR) defines the data type, character encoding, and byte length rules for a data element. When a scanner writes a patient name, a pixel matrix, or a scan date, the VR tells parsers how to turn those raw bytes into meaningful values.

Choosing or parsing the wrong VR does not just raise an error. In many cases, it silently corrupts data: numbers turn into truncated strings, dates lose formatting, and odd byte counts cause parser offsets to slip. Understanding how VRs work helps you write reliable parsers, build validation pipelines, and prevent data corruption in production integrations.

What is a DICOM Value Representation?

Every piece of metadata in a DICOM dataset travels inside a data element. Part 5 of the DICOM standard (PS3.5, Section 6.2) defines each data element using three or four core fields:

  1. Tag: A 4-byte identifier consisting of a 2-byte Group number and a 2-byte Element number (such as (0010,0010) for Patient Name).
  2. Value Representation (VR): A 2-character ASCII code defining the data type (such as PN for Person Name).
  3. Value Length: The length of the payload in bytes.
  4. Value Field: The actual data bytes.

In Explicit VR, the sender writes the 2-character VR code directly into the byte stream. In Implicit VR, the sender omits the code, forcing the receiver to look up the tag in an external dictionary. In both cases, the rules of that VR govern how the value must be encoded.

The core categories of DICOM VRs

The DICOM standard defines 34 distinct Value Representations. You can group them into five practical categories:

1. Plain and structured text strings

Text VRs store human-readable information, identifiers, and codes:

  • AE (Application Entity Title): Up to 16 ASCII characters naming a network service. For rules on formatting and character limits, read our guide on what is a DICOM AE title.
  • CS (Code String): Up to 16 uppercase alphanumeric characters, underscores, and spaces, used for enumerated values like modality types (CT, MR).
  • LO (Long String): Up to 64 characters of descriptive text, such as department names.
  • SH (Short String): Up to 16 characters for short labels.
  • PN (Person Name): Up to 64 characters per component group, structured into 5 components separated by carets: Family^Given^Middle^Prefix^Suffix.
  • UI (Unique Identifier): Up to 64 bytes containing a dot-separated numeric UID string. To understand how UIDs structure studies and series, see our guide on DICOM Instances, Series, and Studies explained.
  • ST, LT, UT (Short, Long, Unlimited Text): Multiline narrative text blocks with maximum lengths of 1,024, 10,240, and $2^{32}-2$ bytes.
  • UC, UR (Unlimited Characters, URI/URL): Modern additions for long Unicode text and web addresses.

2. Formatted numbers represented as strings

DICOM features two distinct string VRs for numeric data. Engineers new to DICOM often confuse them with binary numbers:

  • IS (Integer String): An integer written out as decimal ASCII text (for example, "128" or "-42"), up to 12 characters.
  • DS (Decimal String): A floating-point number formatted as ASCII characters (for example, "3.14159" or "-1.5e-3"), up to 16 characters.

Using string representations for numbers allows systems on different CPU architectures to exchange values without IEEE floating-point precision mismatch. However, they introduce string length limits that can truncate high-precision decimals.

3. Binary numeric types

Binary VRs encode fixed-width binary numbers directly in little-endian or big-endian order, matching the negotiated Transfer Syntax:

  • US (Unsigned Short): 16-bit unsigned integer (2 bytes).
  • SS (Signed Short): 16-bit signed integer (2 bytes).
  • UL (Unsigned Long): 32-bit unsigned integer (4 bytes).
  • SL (Signed Long): 32-bit signed integer (4 bytes).
  • UV, SV (Unsigned / Signed Very Long): 64-bit integers (8 bytes).
  • FL (Floating Point Single): 32-bit IEEE 754 floating-point number (4 bytes).
  • FD (Floating Point Double): 64-bit IEEE 754 double-precision number (8 bytes).
  • AT (Attribute Tag): A 4-byte value representing another DICOM tag, stored as two 16-bit integers (Group and Element).

4. Dates and timestamps

  • DA (Date): 8 characters formatted strictly as YYYYMMDD. Older DICOM versions used YYYY.MM.DD, which modern parsers must still tolerate.
  • TM (Time): 2 to 14 characters formatted as HHMMSS.FFFFFF. Fractional seconds and trailing components can be omitted.
  • DT (Date Time): Up to 26 characters combining date, time, and an optional UTC offset: YYYYMMDDHHMMSS.FFFFFF&ZZXX.

5. Binary byte streams and nested structures

Large or unstructured payloads use specialized binary VRs:

  • OB (Other Byte): An opaque array of bytes, commonly used for compressed pixel fragments or private data.
  • OW (Other Word): An array of 16-bit words, used for uncompressed 16-bit grayscale pixel data.
  • OF, OD, OL, OV: Arrays of 32-bit floats, 64-bit doubles, 32-bit integers, and 64-bit integers.
  • UN (Unknown): Used when an Explicit VR parser cannot identify the type of an element, often encountered when converting legacy Implicit VR streams containing private tags.
  • SQ (Sequence of Items): Contains nested DICOM datasets, allowing complex hierarchical structures like measurement reports and acquisition parameters.

The even-length padding rule

DICOM mandates that all data elements must have an even number of bytes. If a value has an odd number of bytes, the sender must append a single padding byte.

The padding character depends on the VR:

Value Representation Padding Byte Hex Value
UI (Unique Identifier) Trailing Null byte 0x00
OB (Other Byte) Trailing Null byte 0x00
Text VRs (AE, CS, LO, PN, SH, etc.) Trailing Space character 0x20
Numeric string VRs (IS, DS) Trailing Space character 0x20
Binary numbers (US, UL, SS, SL, FL, FD) Never padded (always even byte width) None

This padding rule causes frequent bugs in custom software. For example, if a patient ID is "PAT123" (6 bytes), it needs no padding. If the ID is "PAT12" (5 bytes), the sender writes "PAT12 " (6 bytes).

A conformant parser strips trailing spaces when reading text VRs. However, naive parsers often retain the space. If your application performs exact lookups on patient IDs or accession numbers, that extra space will break search queries.

Value Multiplicity (VM): Handling multiple values

A single DICOM data element can store multiple values of the same VR. This is governed by Value Multiplicity (VM).

For text and string-based numeric VRs, multiple values are separated by a backslash character (\):

Tag: (0028,0030) Pixel Spacing
VR:  DS (Decimal String)
VM:  2
Value: "0.75\0.75"

In this example, the element contains two decimal values representing row and column spacing in millimeters.

Binary VRs handle multiplicity differently. Instead of using text delimiters, binary elements encode multiplicity by repeating fixed-width byte blocks. An element with VR US and VM 3 contains $3 \times 2 = 6$ raw bytes.

If your code assumes every tag has a single value, parsing an element with VM over 1 fails. The parser either crashes or merges distinct values into a single invalid string.

Why wrong VRs corrupt data silently

When software modifies or creates DICOM files, using the wrong VR leads to severe data corruption:

1. The 2-byte versus 4-byte length header split

In Explicit VR encoding, the standard splits VRs into two structural formats. Most short VRs store the Value Length in a 2-byte unsigned integer:

Short VRs (CS, SH, LO, PN, DA, TM, US, UL, etc.):
+---------------+---------------+--------------------+--------------------------+
|  Tag (4 B)    |  VR (2 B)     |  Length (2 B)      |  Value (N bytes)         |
+---------------+---------------+--------------------+--------------------------+

However, VRs designed for large or variable payloads (OB, OW, OF, OD, OL, OV, SQ, UC, UR, UT, and UN) use a different header layout. They place two reserved zero bytes after the VR code, followed by a 4-byte unsigned integer for the length:

Long VRs (OB, OW, SQ, UN, UT, etc.):
+---------------+---------------+--------------------+--------------------+--------------------------+
|  Tag (4 B)    |  VR (2 B)     |  Reserved (2 B)    |  Length (4 B)      |  Value (N bytes)         |
|               |               |  0x0000            |                    |                          |
+---------------+---------------+--------------------+--------------------+--------------------------+

If your tool writes an element using OB but encodes a 2-byte length header, the parser misreads the length. It reads reserved bytes as length data, loses byte alignment, and crashes on subsequent tags.

2. String truncation on numeric types

If an engineer assigns the VR IS (Integer String) to store large accession numbers or counter values, values over 12 characters are invalid. Some sending systems truncate characters exceeding 12 bytes. A counter value like 1000000000012 can be truncated to 100000000001, silently altering record keys.

3. Date and time formatting shifts

Custom software often generates ISO 8601 timestamps like "2026-09-23T09:15:00". If written to a DA tag, the value exceeds the 8-character limit. If written to a DT tag, the hyphens and colons violate the standard format (YYYYMMDDHHMMSS.FFFFFF). Downstream PACS and viewer filters will fail to index the study by date.

Ingestion considerations for cloud pipelines

In modern healthcare pipelines, hospital scanners transmit studies over classic protocols like C-STORE. Downstream cloud applications consume these studies via HTTP webhooks using DICOMweb STOW-RS. For a comparison of both workflows, see our guide on DICOM C-STORE vs DICOMweb STOW-RS.

When bridging classic imaging into cloud services, keep these rules in mind:

  • Validate VR rules at the boundary: Ensure your ingest parsers strictly validate lengths and strip padding spaces before saving attributes into downstream storage.
  • Prefer Explicit VR Little Endian: Configure modalities and gateways to use Explicit VR Little Endian (1.2.840.10008.1.2.1). Explicit VR retains proper types across network boundaries and avoids dictionary fallback ambiguities.
  • Isolate transport from payload validation: Secure the wire using mutual TLS (mTLS) to authenticate hospital senders before processing DICOM datasets. To understand how certificates protect DICOM transfers, read our guide on mutual TLS for DICOM connections.

To learn how to connect hospital imaging equipment to modern webhooks, review our guide to connecting a DICOM sender and explore receiving DICOM deliveries. For full definitions of all 34 Value Representations, consult DICOM Standard Part 5 (PS3.5, Section 6.2).

Dicomly builds infrastructure for healthcare software teams that receive DICOM studies from hospitals. Why we built Dicomly →

Sources

  1. DICOM Standard Part 5 (PS3.5, Section 6.2 — Value Representations) (dicom.nema.org)
  2. DICOM Standard Part 5 (PS3.5, Section 6.4 — Value Multiplicity) (dicom.nema.org)
  3. DICOM Standard Part 5 (PS3.5, Chapter 7 — Data Elements) (dicom.nema.org)

Start receiving DICOM today.

Early access. No credit card. First endpoint free.