Roman Numerals to Numbers Converter Online


Roman Numeral


Number

Related Pages: Roman Numerals Chart 1-1000, Numbers to Roman Numerals.

About Roman Numerals to Numbers Converter:

This online Roman Numerals to Numbers Converter helps you to convert one Roman Numeral into a number (base 10). Put Roman Numeral into the first textbox, the number result will show in the second textbox.

Roman Numerals:

Roman numerals is invented by ancient Rome, it use letters from Latin ("I" for "1", "V" for "5", "X" for "10", "L" for "50", "C" for "100", "D" for "500", "M" for "1000") to represent numbers. Roman numerals is still widely used in academic paper chapter numbering system.

How to convert from Roman Numeral to Number?

  1. Step 1: Remember the Latin letters list ('I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000). Remember its order and each value.

  2. Step 2: From left to right, subtract a letter's corresponding value if it appears before a larger letter.

    Example 2.1: IV = V − I = 5 − 1 = 4

    Example 2.2: XL = X − L = 50 − 10 = 40

  3. Step 3: In other case, add a letter's corresponding value.

    Example 3.1: XXXV = X + X + X + V = 10 + 10 + 10 + 5 = 35

    Example 3.2: CXXIII = C + X + X + I + I + I = 100 + 10 + 10 + 1 + 1 + 1 = 123

Example 1: Convert Roman Numeral "CXLVI" to Number:

roman numerals to numbers example 1

Example 2: Convert Roman Numeral "CDXCIV" to Number:

roman numerals to numbers example 2

Roman Numerals to Numbers conversion table:

Roman Numerals Numbers Roman Numerals Numbers
I 1 XXI 21
II 2 XXII 22
III 3 XXIII 23
IV 4 XXIV 24
V 5 XXV 25
VI 6 XXVI 26
VII 7 XXVII 27
VIII 8 XXVIII 28
IX 9 XXIX 29
X 10 XXX 30
XI 11 XXXI 31
XII 12 XXXII 32
XIII 13 XXXIII 33
XIV 14 XXXIV 34
XV 15 XXXV 35
XVI 16 XXXVI 36
XVII 17 XXXVII 37
XVIII 18 XXXVIII 38
XIX 19 XXXIX 39
XX 20 XL 40

More information:

Wikipedia (Roman numerals): https://en.wikipedia.org/wiki/Roman_numerals

Convert Roman Numerals to Numbers with Python:

def transform_roman_numeral_to_number(roman_numeral):
    roman_char_dict = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}
    res = 0
    for i in range(0, len(roman_numeral)):
        if i == 0 or roman_char_dict[roman_numeral[i]] <= roman_char_dict[roman_numeral[i - 1]]:
            res += roman_char_dict[roman_numeral[i]]
        else:
            res += roman_char_dict[roman_numeral[i]] - 2 * roman_char_dict[roman_numeral[i - 1]]
    return res


roman_numeral_input = 'MMXVIII'
number_output = transform_roman_numeral_to_number(roman_numeral_input)
print('Roman numeral {0} equal to:{1}'.format(roman_numeral_input, number_output))

-------------------
Roman numeral MMXVIII equal to:2018