One field, both directions
Type a number and the page writes the Roman form; type a Roman numeral and it writes the number. The converter decides by looking at the characters, so 2024 and MMXXIV both work in the same box. Numbers run from 1 to 3,999,999 and the Roman form is built greedily from the largest symbol that fits, so 2024 becomes MMXXIV.
A worked example
2024 breaks into 1000 plus 1000 plus 10 plus 10 plus 1 plus 1, giving MMXXIV. Going the other way, MCMXCIV reads as 1000, then 900 because C precedes M, then 90 because X precedes C, then 4 because I precedes V, for 1994. The subtractive pairs are CM, CD, XC, XL, IX and IV.
How the greedy method works
The symbol table starts at 1000 and steps down through the subtractive pairs to 1. At each step the converter takes as many copies as fit and subtracts their value, which produces the standard form: 4000 becomes MMMM, 1990 becomes MCMXC. Repeating symbols is normal below 4000; the overline notation used for larger values is not needed until four million.
Where it stops
- The reverse direction requires the canonical spelling, so non-standard forms such as IIII or VX are rejected rather than read as 4 and 5.
- Lowercase input is accepted and treated as uppercase.
- No overline or vinculum notation.
Questions people ask
What is the largest Roman numeral?
With plain symbols, 3,999,999 is the limit here, written as a very long string of Ms and the rest. Classical inscriptions used an overline to multiply by a thousand.
Why does 4 use IV rather than IIII?
Subtractive notation is the modern standard, though clock faces often use IIII. This tool always produces IV. For other numeral systems try the number base converter or write numbers as words with the number to words converter.