The subtractive rule
Roman numerals normally add values (VI = 5+1 = 6), but a smaller digit before a larger one subtracts: IV = 4, IX = 9, XL = 40, XC = 90, CD = 400, CM = 900. That's why 4 is IV, not IIII, and 1999 is MCMXCIX (1000 + 900 + 90 + 9), not MIM.
Quick reference
| Value | Roman | Value | Roman |
|---|---|---|---|
| 1 | I | 40 | XL |
| 5 | V | 50 | L |
| 9 | IX | 90 | XC |
| 10 | X | 100 | C |
| 14 | XIV | 400 | CD |
| 20 | XX | 500 | D |
| 30 | XXX | 900 | CM |
| 39 | XXXIX | 1000 | M |
Numbers above 3,999 need a vinculum (a bar multiplying by 1,000) — this converter follows the common modern convention and caps at 3,999. Roman numerals have no zero, which is one reason arithmetic in them never caught on.