How Roman numerals work
Seven letters carry the values I = 1, V = 5, X = 10, L = 50, C = 100, D = 500 and M = 1000. Letters are added from left to right (VIII = 8), except that a smaller letter placed before a larger one is subtracted (IV = 4, XC = 90). Only six subtractive pairs are standard: IV, IX, XL, XC, CD and CM.
Range
The standard notation goes from 1 to 3999 (MMMCMXCIX). There is no zero and no negative number. Larger values were written with a bar over the letters to multiply them by 1000, which plain text cannot show, so they are not supported here.
Non-standard forms
Clocks often show IIII instead of IV, and you will meet forms like IC for 99 or IIX for 8. The tool still reads them, gives the value, and shows the standard spelling next to it so you can correct a date or a chapter number.
Example
Both directions in one list, plus a clock-face form that is not standard.
Input
2026 MCMXCIV IIII
Output
2026 = MMXXVI MCMXCIV = 1994 IIII = 4 (not standard: usually written IV)
