Roman numerals encode numbers using seven letters whose values are added or, in specific pairs, subtracted. This tool converts integers to Roman numerals and back, and it validates Roman input so malformed numerals are caught rather than silently misread.
How it works
Number-to-Roman uses a greedy algorithm over a fixed value table that includes the six subtractive pairs. It repeatedly appends the largest numeral that does not exceed the remaining value:
1000 M 900 CM 500 D 400 CD
100 C 90 XC 50 L 40 XL
10 X 9 IX 5 V 4 IV 1 I
Roman-to-number scans the string from right to left: each symbol is added unless
it is smaller than the symbol to its right, in which case it is subtracted (so the
I in IX is subtracted). To guarantee the input was well-formed, the tool then
converts the result back to a canonical numeral and compares; if they differ — as
they would for IIII or IC — it reports the input as invalid and shows the
correct form.
Example and notes
The current year 2026 is MMXXVI: two thousands (MM), two tens (XX), a five (V),
and a one (I). The subtractive rule keeps numerals short — 1999 is MCMXCIX, not
a long string of identical letters. The validator enforces the real rules of the
system: I, X, C, and M may repeat up to three times, while V, L, and D never
repeat. Anything outside 1 to 3999, or any letter beyond I, V, X, L, C, D, M, is
rejected with an explanation.