Roman Numeral Converter
Convert a whole number from 1 to 3999 into a Roman numeral, or read a Roman numeral back into a number. Only the standard form is accepted, so IIII and IC are refused.
Type in either box. The result follows the box you typed in last. Upper and lower case are both accepted.
How it works
Each letter has a value: I = 1, V = 5, X = 10, L = 50, C = 100, D = 500 and M = 1000. Letters are added from left to right. When a smaller letter comes before a larger one, its value is subtracted instead, which gives the six subtractive pairs: IV = 4, IX = 9, XL = 40, XC = 90, CD = 400 and CM = 900.
The rules used are these. I, X, C and M may repeat up to three times in a row. V, L and D are never repeated. I may be placed only before V or X, X only before L or C, and C only before D or M (so IX is valid, but IL is not). The numerals cover 1 to 3999, so MMMCMXCIX is the largest.
A numeral is accepted only if it is the one standard spelling of its value. The tool converts the numeral to a number, writes that number back as a numeral, and compares the two. So IIII is refused (write IV), VV is refused (write X), IC is refused (write XCIX), LM is refused (write CML) and IIX is refused (write X). Zero, negative numbers, decimals and numbers above 3999 have no Roman numeral here, and are refused with a message.
Upper and lower case are both accepted, and the result is always shown in upper case. Spaces around the text are ignored. Nothing you enter is sent anywhere or stored: the conversion runs in your browser.