Roman Numeral Rules
The Roman numeral system uses seven symbols to represent values: I (1), V (5), X (10), L (50), C (100), D (500), and M (1000). Numbers are formed by combining these symbols using two core principles.
Additive notation places symbols from largest to smallest, left to right. Each symbol adds its value to the total. For example, VIII is 5 + 1 + 1 + 1 = 8 and CLXVI is 100 + 50 + 10 + 5 + 1 = 166.
Subtractive notation handles the 4s and 9s. When a smaller symbol appears directly before a larger one, you subtract instead of add. There are exactly six subtractive pairs: IV (4), IX (9), XL (40), XC (90), CD (400), and CM (900). This keeps any symbol from being repeated more than three times in a row.
Because M is the largest standard symbol, the highest representable number is MMMCMXCIX (3999). Historical texts occasionally extended the system with an overline (vinculum) to multiply by 1000, but the standard set covers 1 through 3999.
Where Roman Numerals Appear Today
Despite being over two thousand years old, Roman numerals remain surprisingly common in modern contexts:
- Major events -- the Super Bowl uses Roman numerals for each edition (Super Bowl LVIII, for example), and the Olympic Games number their Olympiads the same way.
- Film and television -- copyright dates in movie credits are almost always written in Roman numerals, such as
MMXXVIfor 2026. - Clock faces -- many analog clocks and watches use Roman numerals on their dials, often writing 4 as
IIIIinstead ofIVfor visual symmetry. - Book chapters and outlines -- legal documents, academic papers, and textbooks frequently number sections, chapters, and appendices with Roman numerals.
- Monarchs and popes -- names like Henry VIII or Pope Benedict XVI use Roman numerals to distinguish individuals who share the same regnal name.
Conversion Algorithm
Converting a decimal number to Roman numerals uses a greedy algorithm. You start with a lookup table of values sorted from largest to smallest -- { 1000: "M", 900: "CM", 500: "D", 400: "CD", ... } -- then repeatedly subtract the largest possible value and append its symbol to the result.
For example, converting 1994: subtract 1000 (M), leaving 994. Subtract 900 (CM), leaving 94. Subtract 90 (XC), leaving 4. Subtract 4 (IV), leaving 0. The result is MCMXCIV. The algorithm runs in constant time because the maximum number of iterations is bounded by the table size multiplied by the repeat limit.
Converting in the other direction -- Roman to decimal -- works by scanning left to right. If the current symbol is smaller than the next one, subtract it; otherwise, add it. This single-pass approach handles both additive and subtractive notation cleanly and runs in O(n) time where n is the length of the numeral string.
Related Number Conversion Tools
If you work with different numbering systems regularly, these tools can help:
- Number Base Converter -- convert between binary, octal, decimal, and hexadecimal with arbitrary bases up to 36.
- Hex to Decimal Converter -- quickly translate hexadecimal values to their decimal equivalents, useful for color codes and memory addresses.
- Binary to Decimal Converter -- convert binary strings to decimal numbers and back, a common task when working with low-level data or networking.