Roman Numeral Converter

Convert numbers into Roman numerals, translate Roman numerals into ordinary numbers, and explore step-by-step explanations of how Roman numeral notation works.

Canonical mode accepts only the unique modern form for 1–3999. Alternative mode also recognizes documented additive place-values such as IIII. Extended mode uses an overlined thousands group written in plain text as (GROUP)remainder, for 4000 through 3,999,999.

Round-trip check: a valid Roman string must convert to a decimal integer whose greedy conversion returns the same string. IC is rejected because 99 is XCIX. Nested parentheses and noncanonical groups are rejected in extended mode.

  • Standard range: 1 = I through 3999 = MMMCMXCIX.
  • Zero, negatives, and fractions are not written as canonical numerals.
  • Plain-text extended example: 12500 = (XII)D.

The opening value 2026 → MMXXVI is a labelled example, not a saved visitor conversion.

Conversion result

MMXXVI

How the greedy algorithm works

The converter does not look up a short table of famous years. It iterates thirteen value-symbol pairs. For 944 it writes CM, then XL, then IV, leaving remainder 0, so the result is CMXLIV. Every integer from 1 through 3999 is produced the same way.

Roman-to-number parsing trims whitespace, uppercases ASCII letters, validates structure, then sums tokens. Subtractive pairs apply only when the selected mode permits them. Invalid canonical strings are rejected even if a naive left-to-right subtraction would invent a value.

Extended overline convention

For n from 4000 through 3,999,999, let q = floor(n / 1000) and r = n mod 1000. Convert q with the standard converter and overline that group. If r is greater than zero, append its ordinary canonical writing. Plain-text form uses parentheses: 4000 = (IV), 5000 = (V), 12000 = (XII), 12500 = (XII)D, 1000000 = (M), 3999999 = (MMMCMXCIX)CMXCIX. Nested parentheses and noncanonical groups are rejected.

Open the validator · Read the conversion guide