How Roman numerals work
Roman numerals use seven letters: I = 1, V = 5, X = 10, L = 50, C = 100, D = 500, M = 1000. You build a number by adding letters from largest to smallest, so MMXXIV is 1000 + 1000 + 10 + 10 + 1 + 4 = 2024. The tool above converts numbers to Roman numerals and back, which is handy for dates, clock faces, book chapters, film sequels and monarchs' names.
The subtractive rule. To avoid four of a symbol in a row, a smaller letter placed before a larger one is subtracted: IV is 4 (not IIII), IX is 9, XL is 40, XC is 90, CD is 400 and CM is 900. Only those specific pairs are used, and you never subtract more than one symbol at a time, which is why 999 is CMXCIX, not IM.
The limits. Standard Roman numerals have no zero and no way to write very large numbers neatly, topping out in normal use around 3,999 (MMMCMXCIX). That is fine for years, ordinals and decorative numbering, which is all they are really used for today. For anything requiring arithmetic, decimal numbers are far more practical.