Arabic Number to Roman Numeral Converter
Convert arabic numbers to roman numerals and roman numerals back to arabic numbers instantly. Supports values from 1 to 3,999,999 with vinculum notation.
About
Roman numeral encoding follows a subtractive notation system where 13 distinct symbol pairs map every positive integer from 1 to 3999 in standard form. Misreading a single numeral on a legal document, clock face, or manuscript index corrupts the referenced value entirely. The algorithm here implements the canonical greedy decomposition: iterate through the ordered value table V = {1000, 900, 500, âĶ, 1}, subtracting each entry and appending its corresponding symbol until the remainder reaches zero. Reverse parsing applies the left-to-right comparison rule: if a symbol's value is less than its successor's, subtract it. This tool extends coverage to 3,999,999 via vinculum (overline) notation, where a bar above a numeral multiplies its value by 1000.
Input validation rejects malformed sequences such as IIII or VV that violate repetition rules. The converter also detects input type automatically. Type digits and receive roman numerals. Type roman letters and receive the arabic equivalent. Note: this tool assumes standard Western roman numeral conventions. Medieval and Unicode variant forms are not supported.
Formulas
The arabic-to-roman conversion uses a greedy decomposition algorithm. Given an input integer n, the algorithm iterates through an ordered lookup table of 13 value-symbol pairs and repeatedly subtracts the largest applicable value:
for each (value, symbol) in table:
while n âĨ value:
result += symbol
n â= value
The reverse operation (roman-to-arabic) applies the subtractive comparison rule:
for i = 0 to len(s) â 1:
if val(si) < val(si+1):
total â= val(si)
else:
total += val(si)
Where val(si) returns the numeric value of the roman character at position i. The subtractive rule handles pairs like IV (4) and CM (900). Vinculum notation multiplies base values by 1000 for numbers exceeding 3999.
Reference Data
| Roman Numeral | Arabic Value | Rule |
|---|---|---|
| I | 1 | Base unit |
| IV | 4 | Subtractive: 5 â 1 |
| V | 5 | Base unit |
| IX | 9 | Subtractive: 10 â 1 |
| X | 10 | Base unit |
| XL | 40 | Subtractive: 50 â 10 |
| L | 50 | Base unit |
| XC | 90 | Subtractive: 100 â 10 |
| C | 100 | Base unit |
| CD | 400 | Subtractive: 500 â 100 |
| D | 500 | Base unit |
| CM | 900 | Subtractive: 1000 â 100 |
| M | 1000 | Base unit |
| IĖ VĖ | 4,000 | Vinculum: 4 Ã 1000 |
| VĖ | 5,000 | Vinculum: 5 Ã 1000 |
| XĖ | 10,000 | Vinculum: 10 Ã 1000 |
| LĖ | 50,000 | Vinculum: 50 Ã 1000 |
| CĖ | 100,000 | Vinculum: 100 Ã 1000 |
| DĖ | 500,000 | Vinculum: 500 Ã 1000 |
| MĖ | 1,000,000 | Vinculum: 1000 Ã 1000 |
| MCMXCIX | 1999 | Common example |
| MMXXV | 2025 | Current year |
| MMMCMXCIX | 3999 | Max standard value |