Convert Arabic numbers to Roman numerals and back, supporting 1–3999 with automatic validation.
| Symbol | Value |
|---|---|
| I | 1 |
| V | 5 |
| X | 10 |
| L | 50 |
| C | 100 (centum) |
| D | 500 |
| M | 1000 (mille) |
Symbols written largest to smallest are added: XVI is 10 + 5 + 1 = 16. When a smaller symbol precedes a larger one, it is subtracted — but only six pairings are permitted:
| Written | Value | Why |
|---|---|---|
| IV | 4 | 1 before 5 |
| IX | 9 | 1 before 10 |
| XL | 40 | 10 before 50 |
| XC | 90 | 10 before 100 |
| CD | 400 | 100 before 500 |
| CM | 900 | 100 before 1000 |
Anything else is invalid in modern usage. IC for 99 is not correct — the accepted form is XCIX.
The standard subtractive notation has no symbol beyond M, and a numeral may not repeat more than three times, so the largest representable value in the common form is MMMCMXCIX = 3999. Historical Romans handled larger numbers in several inconsistent ways, and later writers used a bar over a symbol to multiply it by a thousand, but neither is part of the everyday system.
The decomposition is mechanical: split the number into thousands, hundreds, tens and units, then take each part straight from the subtraction table.
1994 = 1000 + 900 + 90 + 4
= M + CM + XC + IV → MCMXCIV
2026 = 2000 + 20 + 6
= MM + XX + VI → MMXXVI
444 = 400 + 40 + 4
= CD + XL + IV → CDXLIV
Reading back is the same table in reverse. Nearly every mistake comes from skipping it and writing symbols in a form that looks plausible:
| Wrong | Correct | Value | Why it fails |
|---|---|---|---|
IIII | IV | 4 | No symbol may repeat four times |
IIX | VIII | 8 | A symbol only subtracts from the next one or two above it |
IC | XCIX | 99 | I may only precede V or X, never C |
IL | XLIX | 49 | I cannot skip past X to reach L |
VX | V | 5 | V is never used as the subtracting symbol |
The clock-face exception is real but decorative: IIII appears on many dials for visual balance with VI on the opposite side, not because it obeys the rules.