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

A number 1–3999, or a Roman numeral such as MCMLXXXVII.

Result
MCMLXXXVII
Canonical
yes
Formula
1987 = MCMLXXXVII

Supported formats

Input
text, select
Output
text, number

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

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.
textSelect to copy
1987 = MCMLXXXVII
  • Standard-form Roman numerals use subtractive pairs (IV, IX, XL, XC, CD, CM) and no symbol repeats more than three times.

Methodology

  1. For number → Roman, repeatedly subtract the largest representable unit (including the subtractive pairs CM, CD, XC, XL, IX, IV).
  2. For Roman → number, scan left to right matching the same unit table in descending order, so subtractive pairs are consumed before their components.
  3. Re-encode the parsed value and require it to equal the input, so only canonical numerals are accepted.
  4. Constrain the range to 1–3999, the span the seven standard symbols cover unambiguously.

Usage

  1. Choose the direction: number to Roman, or Roman to number.
  2. Enter the value.
  3. 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

jsonSelect to copy
{
  "mode": "to-roman",
  "value": "1987"
}

4 to Roman

jsonSelect to copy
{
  "mode": "to-roman",
  "value": "4"
}

3999 to Roman

jsonSelect to copy
{
  "mode": "to-roman",
  "value": "3999"
}

MCMXCIV to decimal

jsonSelect to copy
{
  "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

  1. ISO 80000-2:2019 — Quantities and units, Part 2: Mathematics — ISO
  2. The Unicode Standard — Roman Numeral characters — Unicode Consortium