Roman Numerals, Explained
After reading this you will be able to convert any whole number from 1 to 3999 into a Roman numeral, read a numeral back into a number, and spot the strings that only look valid.
What Roman numerals are
Roman numerals write numbers with seven letters. Each letter stands for a fixed value: I is 1, V is 5, X is 10, L is 50, C is 100, D is 500, and M is 1000. You build a number by placing these letters in order and adding their values, with one twist that handles the awkward cases like 4 and 9.
Take the year 1994. In Roman numerals it is MCMXCIV. That breaks into M (1000), CM (900), XC (90) and IV (4). Add them: 1000 + 900 + 90 + 4 = 1994. The system is a place-free tally with shortcuts, not a positional base like decimal.
When to use them, and when not
Roman numerals are useful for a narrow set of jobs. You see them on clock faces, in book chapter and preface numbering, on building cornerstones, in movie copyright dates, and for ranking monarchs and popes (Henry VIII, Pius IX). For those tasks the range 1 to 3999 is plenty.
They are a poor choice for arithmetic. There is no zero, no negative numbers, and no fractions in the standard system. Multiplying XLVII by XIX by hand is painful compared to 47 × 19 = 893. If you need real computation, convert to Arabic first. If you need other number systems, the Number base converter handles binary, hex and any base from 2 to 36.
The rules, made precise
Two rules cover almost everything.
Additive rule. When a symbol is followed by one of equal or smaller value, you add. So VI is 5 + 1 = 6 and XXX is 10 + 10 + 10 = 30.
Subtractive rule. When a smaller symbol comes directly before a larger one, you subtract the smaller from the larger. So IV is 5 - 1 = 4 and CM is 1000 - 100 = 900.
Standard notation allows exactly six subtractive pairs. Memorize these and you have the whole system:
| Pair | Value | Read as |
|---|---|---|
IV | 4 | 5 - 1 |
IX | 9 | 10 - 1 |
XL | 40 | 50 - 10 |
XC | 90 | 100 - 10 |
CD | 400 | 500 - 100 |
CM | 900 | 1000 - 100 |
You may repeat I, X, C and M up to three times in a row (III is 3, XXX is 30). You never repeat V, L or D, since two of them would just equal the next symbol up (VV would be X). Only I, X and C ever subtract, and each subtracts from only its next two larger symbols.
Converting a number to a numeral
The clean way to convert a number is greedy subtraction against a fixed list of thirteen values. Walk the list from largest to smallest. At each value, emit its symbol as many times as it fits, then subtract.
Each pair is a value and the string that represents it. Because the subtractive cases (900, 400, 90, 40, 9, 4) are baked into the list, the greedy pass never produces an illegal string. It always yields the one standard numeral for the input.
The greedy method works here because the value list is designed so that no smaller combination is ever cheaper. That is not true for every coin system, but it is true for these thirteen values, which is why the answer is always unique.
Worked example: 1994 to MCMXCIV
Set Mode to Number → Roman and enter 1994, the demo values. Run the greedy pass:
- Start with 1994. The largest value that fits is 1000 (
M). EmitM, leaving 1994 - 1000 = 994. - 900 (
CM) fits into 994. EmitCM, leaving 994 - 900 = 94. - 90 (
XC) fits into 94. EmitXC, leaving 94 - 90 = 4. - 4 (
IV) fits exactly. EmitIV, leaving 0.
Concatenate the pieces: M + CM + XC + IV = MCMXCIV. Reading it back adds to 1000 + 900 + 90 + 4 = 1994, so the round trip is consistent.
Converting a numeral to a number
To read a numeral, scan left to right and compare each symbol with the one after it. If the current value is at least as large as the next, add it. If it is smaller, subtract it. The last symbol is always added.
Here v_i is the value of the symbol at position i, and v_{i+1} is the value of the next symbol (treat the value after the last symbol as 0). For MCMXCIV the sign pattern is +1000, -100, +1000, -10, +100, -1, +5, which sums to 1994. Notice the two C values: the first is subtracted because M follows, the second is added because I follows.
Validation: strings that only look right
Many strings pass a casual glance but are not standard numerals. The converter rejects them rather than guessing. A string is valid only if converting its numeric value back produces the exact same string.
| Written | Problem | Standard form |
|---|---|---|
IIII | Four I in a row | IV (4) |
IL | I cannot subtract from L | XLIX (49) |
VX | V never subtracts | V (5) |
MMMM | Exceeds 3999 | out of range |
IC | I cannot subtract from C | XCIX (99) |
Clock faces often show IIII for 4 instead of IV. That is a traditional style, not standard notation. The converter treats IIII as invalid, so type IV if you want the number 4.
Explore the additive and subtractive split
The interesting behavior is how a numeral flips between adding and subtracting as you slide through consecutive numbers. Watch 3, 4, 5 turn from III to IV to V, and 39, 40 turn from XXXIX to XL.
Related tools
Roman numerals are one way to write whole numbers. For other representations and deeper number work, these pages help:
- Number base converter for binary, octal, decimal and hex.
- Prime factorization and number theory for factors, divisors and GCD.
- Big number calculator for exact arithmetic on very large integers.
- Scientific notation and significant figures for compact large-number formats.
- Fraction to decimal to continued fraction for exact rational conversions.
- Combinatorics for counting with nCr and nPr.
Frequently asked questions
Why does the converter stop at 3999?
Standard notation has no symbol above M (1000), and you may write at most three M in a row. That caps the plain system at 3000 + 900 + 90 + 9 = 3999, written MMMCMXCIX. Larger values use overlines that multiply by 1000, but those are not part of the standard letter set here.
Is there a Roman numeral for zero?
No. The system has no zero. The smallest value it can write is 1, as I. Medieval writers occasionally used the word nulla for zero, but there is no letter for it.
Does case matter?
Values do not depend on case, so mcmxciv means the same as MCMXCIV. Standard presentation uses uppercase, and the converter reads either while returning uppercase.
Why is IIII wrong but III fine?
You may repeat I at most three times. Four ones is written with a subtractive pair, IV, so IIII is nonstandard even though it clearly means 4. Clocks are a stylistic exception, not the rule.
What is the longest numeral in range?
The number 3888 gives MMMDCCCLXXXVIII, which is 15 characters. It packs the most repeated symbols before subtractive pairs would shorten the count.