正在加载,请稍候…

Roman Numeral Converter: How to Read and Write Roman Numerals

Convert between decimal numbers and Roman numerals. Learn the rules, symbols, subtraction principle, and the fascinating history behind Roman numerals.

What Are Roman Numerals?

Roman numerals are a numeral system that originated in ancient Rome and were the dominant notation in Europe for centuries. They use Latin alphabet letters to represent values and combine them through addition and subtraction rules.

Despite being replaced by the Hindu-Arabic numeral system for everyday arithmetic, Roman numerals remain in common use today on clock faces, book chapter numbers, movie sequels, year designations, outlines, and event names like Super Bowl numbers.

The Seven Symbols

Symbol Value
I 1
V 5
X 10
L 50
C 100
D 500
M 1,000

The Subtractive Rule

Roman numerals use subtractive notation to avoid four identical symbols in a row:

Roman Value Rule
IV 4 I before V = 5-1
IX 9 I before X = 10-1
XL 40 X before L = 50-10
XC 90 X before C = 100-10
CD 400 C before D = 500-100
CM 900 C before M = 1000-100

Only these six subtractive combinations are standard. You write 999 as CMXCIX, not IM.

Roman Numeral Examples

Arabic Roman Breakdown
4 IV 5-1
9 IX 10-1
14 XIV 10+4
40 XL 50-10
399 CCCXCIX 300+90+9
1776 MDCCLXXVI 1000+700+70+6
2025 MMXXV 2000+20+5
3999 MMMCMXCIX 3000+900+90+9

Conversion Algorithm

Arabic to Roman:

def to_roman(num):
    values = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
    symbols = ['M','CM','D','CD','C','XC','L','XL','X','IX','V','IV','I']
    result = ''
    for i, v in enumerate(values):
        while num >= v:
            result += symbols[i]
            num -= v
    return result

to_roman(2025)  # "MMXXV"

Roman to Arabic:

def from_roman(s):
    values = {'I':1, 'V':5, 'X':10, 'L':50, 'C':100, 'D':500, 'M':1000}
    result = 0
    for i in range(len(s)):
        curr = values[s[i]]
        next_val = values[s[i+1]] if i+1 < len(s) else 0
        if curr < next_val:
            result -= curr
        else:
            result += curr
    return result

Limits of Roman Numerals

The standard system covers 1-3,999. For numbers 4,000 and above, historical texts used a bar over a symbol (vinculum) to multiply it by 1,000, but these extensions are rarely used today. Zero has no Roman numeral - the concept of zero was not part of ancient Roman mathematics.

Roman Numerals in Modern Usage

Roman numerals appear in many modern contexts. Clocks and watches traditionally use Roman numerals. Formal outlines use Roman numerals for top-level sections (I, II, III). Film and TV use them for sequel numbering (Star Wars Episode VII, Super Bowl LVIII). Royal and papal names use them (King Charles III, Pope John Paul II). Architecture commonly shows the year of construction in Roman numerals on building cornerstones. The Olympics numbers each edition (XXXIII Olympiad = Paris 2024).

-> Try the Roman Numeral Converter