The Standard Engine.
MathematicsFinanceHealthPhysicsEngineeringBrowse all

Everyday Life · General Mathematics

Roman Numeral Converter

Converts any integer between 1 and 3999 to its Roman numeral representation, and converts Roman numerals back to integers.

Calculator

Advertisement

Formula

A Roman numeral is formed by selecting symbol-value pairs (I=1, V=5, X=10, L=50, C=100, D=500, M=1000) plus the six subtractive pairs (IV=4, IX=9, XL=40, XC=90, CD=400, CM=900). To convert an integer N to Roman numerals, repeatedly subtract the largest available symbol value and append that symbol until N reaches zero. To convert Roman to integer, sum the values of all symbols, applying subtractive notation when a smaller value precedes a larger one.

Source: ISO 8859, traditional Roman numeral convention; also documented in Donald Knuth, The Art of Computer Programming, Vol. 1.

How it works

Roman numerals use seven core symbols — I (1), V (5), X (10), L (50), C (100), D (500), and M (1000) — combined according to additive and subtractive rules. When a symbol of smaller value appears immediately before one of larger value, it is subtracted rather than added. The six recognised subtractive pairs are: IV (4), IX (9), XL (40), XC (90), CD (400), and CM (900). These pairs allow any integer from 1 to 3,999 to be expressed uniquely without repeating a single symbol more than three times consecutively.

To convert an integer N to Roman numerals, the algorithm works greedily: starting from the largest value (1000 = M), it repeatedly subtracts the largest value that fits into the remaining total, appending the corresponding symbol each time, until the total reaches zero. To convert in the opposite direction, the algorithm scans each character left to right, adding its value to a running total — except when the current symbol is smaller than the next, in which case the current symbol's value is subtracted (subtractive notation). The final total is the decimal integer.

Roman numerals are used across many professional and cultural contexts. Architects and historians use them in building cornerstones and inscriptions. Publishers use them for front-matter page numbering. The entertainment industry numbers sequels and Super Bowl editions in Roman numerals. Legal and formal documents frequently use them for section numbering. Understanding both directions of conversion is therefore a practical literacy skill.

Worked example

Example 1 — Integer to Roman: 2025

Start with N = 2025.

  • 2025 ÷ 1000 = 2 remainder 25 → append MM, N = 25
  • 25 ÷ 10 = 2 remainder 5 → append XX, N = 5
  • 5 ÷ 5 = 1 remainder 0 → append V, N = 0

Result: MMXXV

Example 2 — Roman to Integer: MCMXCIX

Parse each symbol: M=1000, C=100, M=1000, X=10, C=100, I=1, X=10.

  • M (1000) — next is C (100), 1000 > 100 → add: total = 1000
  • C (100) — next is M (1000), 100 < 1000 → subtract: total = 900
  • M (1000) — next is X (10), 1000 > 10 → add: total = 1900
  • X (10) — next is C (100), 10 < 100 → subtract: total = 1890
  • C (100) — next is I (1), 100 > 1 → add: total = 1990
  • I (1) — next is X (10), 1 < 10 → subtract: total = 1989
  • X (10) — no next → add: total = 1999

Result: 1999

Limitations & notes

This calculator follows the classical standard Roman numeral system, which covers integers from 1 to 3,999 only. The number zero has no representation in Roman numerals — the concept of zero was absent from ancient Roman mathematics. Numbers of 4,000 and above traditionally required an overline (vinculum) notation to multiply a symbol by 1,000, but this system is not universally standardised and is therefore not supported here. The converter uses strict subtractive notation (IV, IX, XL, XC, CD, CM) and does not accept non-standard forms such as IIII for 4 or VIIII for 9, even though these appear on some clock faces. When converting Roman to integer, the calculator does not perform full validation of legal Roman numeral sequences — an invalid string such as 'VV' will still produce a numerical output (10) rather than an error, so users should verify inputs visually.

Frequently asked questions

What is the largest number that can be written in Roman numerals?

Using the classical seven-symbol system (I, V, X, L, C, D, M) without any extensions, the largest expressible number is 3,999, written as MMMCMXCIX. Numbers from 4,000 upward require the vinculum (overline) convention, where a bar over a symbol multiplies it by 1,000, but this is not standardised across all sources.

Why does IV mean 4 and not 6 in Roman numerals?

In Roman numeral subtractive notation, when a symbol of smaller value (I = 1) is placed immediately before a symbol of larger value (V = 5), it is subtracted: 5 − 1 = 4. This rule applies only to six specific pairs: IV, IX, XL, XC, CD, and CM. In all other cases, symbols are additive.

Why don't Roman numerals have a zero?

Roman numerals evolved from tally-mark systems used in ancient Rome, which had no concept or symbol for zero. Zero as a mathematical placeholder was independently developed in India and transmitted to Europe via Arabic mathematicians in the medieval period. The Latin word 'nulla' (nothing) was occasionally used, but had no symbolic representation in the numeral system.

Why do some clocks show IIII instead of IV for the number 4?

The use of IIII on clock faces is a historical and aesthetic tradition, not a mathematical one. It is thought that IIII was preferred because it creates visual balance with VIII on the opposite side of the dial, and because it was considered disrespectful to abbreviate the name of the god Jupiter (IVPITER) with IV. Both forms are encountered in practice, but standard modern Roman numeral convention uses IV.

How are Roman numerals used in modern professional contexts?

Roman numerals remain common in copyright notices on films and television programmes (e.g. MMXXV for 2025), in legal and legislative document section numbering, in the titles of major sporting events like the Super Bowl and the Olympic Games, in academic front matter (introductory pages numbered i, ii, iii), in clock and watch design, and in formal personal names to indicate generational succession (e.g. King Charles III).

Last updated: 2025-01-15 · Formula verified against primary sources.