Roman Numeral Converter
Convert between Roman numerals and decimal numbers for values 1 to 3999.
- Runs locally in your browser
- No upload required
Try it
Supported formats
Privacy
Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.
1987 = MCMLXXXVII
How it works
- Read the decimal value and matched the largest Roman unit repeatedly.
- Confirmed the value lies in the canonical 1–3999 range.
- Reported the converted value.
1987 = MCMLXXXVII- Standard-form Roman numerals use subtractive pairs (IV, IX, XL, XC, CD, CM) and no symbol repeats more than three times.
Methodology
- For number → Roman, repeatedly subtract the largest representable unit (including the subtractive pairs CM, CD, XC, XL, IX, IV).
- For Roman → number, scan left to right matching the same unit table in descending order, so subtractive pairs are consumed before their components.
- Re-encode the parsed value and require it to equal the input, so only canonical numerals are accepted.
- Constrain the range to 1–3999, the span the seven standard symbols cover unambiguously.
Usage
- Choose the direction: number to Roman, or Roman to number.
- Enter the value.
- Read the converted value and whether the Roman form is canonical.
Examples
These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.
1987 to Roman
{
"mode": "to-roman",
"value": "1987"
}4 to Roman
{
"mode": "to-roman",
"value": "4"
}3999 to Roman
{
"mode": "to-roman",
"value": "3999"
}MCMXCIV to decimal
{
"mode": "to-decimal",
"value": "MCMXCIV"
}Limitations
The seven symbols
Roman numerals use seven symbols — I (1), V (5), X (10), L (50), C (100), D (500) and M (1000). Values are formed by adding symbols, except where a smaller symbol precedes a larger one and is subtracted (IV, IX, XL, XC, CD, CM).
That subtractive rule and the no-more-than-three-repeats rule are what make the notation canonical; the tool enforces both so its output round-trips exactly.
Frequently asked questions
- Why is 4 written IV and not IIII?
- Standard-form Roman numerals use the subtractive principle: a smaller symbol before a larger one is subtracted, so 4 is IV and 9 is IX. IIII is a non-canonical clock-face variant.
- What is the largest standard Roman numeral?
- 3999, written MMMCMXCIX. The next value, 4000, needs a symbol (such as an overscored IV) that is outside the standard seven-symbol set.
- Why does 1987 become MCMLXXXVII?
- 1987 = 1000 + 900 + 50 + 30 + 7; the symbols are M, CM, L, three X's and VII, concatenated as MCMLXXXVII.
Sources
- ISO 80000-2:2019 — Quantities and units, Part 2: Mathematics — ISO
- The Unicode Standard — Roman Numeral characters — Unicode Consortium
Send feedback
Tell us if this tool helped, report a problem, or suggest a tool. Only the message you type is sent — never the input you used in the tool.
Was this tool useful?
Prefer to write to us directly? See the contact page.