Example 1
- Direction: number to Roman numerals
- 2026
MMXXVI
Two Ms (2000), XX (20), VI (6).
Enter a whole number from 1 to 3999 or a canonical Roman numeral. The calculator converts both ways: 2026 is MMXXVI, 14 is XIV. It uses subtractive pairs IV, IX, XL, XC, CD, and CM. IIII is not accepted — 4 is IV.
Enter a number from 1 to 3999 or a Roman numeral. The result will appear here.
This is not a full date generator and not a cipher. Positional systems are on bin, hex and dec.
Roman numerals are a numeral system based on seven Latin letters: I = 1, V = 5, X = 10, L = 50, C = 100, D = 500, M = 1000. Values are usually written from the largest token to the smallest. Beside pure addition (XVII = 10+5+1+1), modern schoolbook notation uses six subtractive pairs: IV, IX, XL, XC, CD, and CM. This calculator implements exactly that canonical convention for whole numbers from 1 to 3999.
Arabic-to-Roman conversion is greedy: from the token list [1000→M, 900→CM, …, 4→IV, 1→I] the calculator subtracts the largest possible token until the remainder is zero. For 2026: two Ms (2000), then XX (20), then VI (6) → MMXXVI. For 14: X + IV → XIV. For 3999: MMM + CM + XC + IX → MMMCMXCIX.
The other way, the calculator scans an MDCLXVI string with the same tokens from the left, sums the values, and checks that toRoman(n) equals the normalized input (uppercase, no spaces). That is why IIII, VV, and IC fail — even though some historical or clock-face variants existed alongside the schoolbook form.
The calculator uses the direction (rom-dir) and the value (rom-value) you enter. This is not a full calendar-date converter and not a Caesar cipher — only a bijection between an integer 1–3999 and its canonical Roman string.
Control examples: 2026 ↔ MMXXVI; 14 ↔ XIV; 44 → XLIV; 1990 → MCMXC; 3999 → MMMCMXCIX; XLIX → 49. The same numbers appear in the clickable examples and in the FAQ.
I=1, V=5, X=10, L=50, C=100, D=500, M=1000; subtractive pairs: IV=4, IX=9, XL=40, XC=90, CD=400, CM=900.
Arabic → Roman: greedy tokens from the (1000,…,1) list until the remainder is 0. Roman → Arabic: sum the same tokens from the left, then require toRoman(n) = string.
Domain: n ∈ {1,…,3999}. Mathematical model: canonical Roman numerals with subtractive notation (schoolbook Roman numerals; Menninger / Ifrah / Chrisomalis for historical context).
Roman numerals assign integer values to seven Latin letters: I=1, V=5, X=10, L=50, C=100, D=500, M=1000. A numeral is a finite string of those marks read under additive and subtractive rules. In schoolbook (canonical) convention the only subtractive pairs are IV, IX, XL, XC, CD, and CM; otherwise a smaller mark does not precede a larger one. The toRoman function on this page is a bijection from {1,…,3999} onto the set of canonical strings from I to MMMCMXCIX.
The inverse first sums tokens greedily from the left (longest matching token from the MAP list), then requires equality with toRoman(n). That second check rejects non-canonical forms even when a naive letter sum would yield a “correct” arithmetic value (for example IIII = 4 arithmetically, but canonically 4 = IV).
This calculator’s domain excludes zero, fractions, negatives, and integers ≥ 4000. Classical Roman notation had no zero symbol; larger values were historically marked with a vinculum (overline, ×1000) among other extensions — outside this calculator’s range.
Roman notation grows out of earlier Italic and Etruscan practices; marks resembling I, V, and X appear in epigraphy before the alphabet was fully Latinized. Karl Menninger in Number Words and Number Symbols traces the path from tally strokes and “fives” shaped like a hand or angle to the seven-letter set used in Roman administration and inscriptions. Georges Ifrah in The Universal History of Numbers stresses that the system was a recording and public-accounting tool, not a positional base-ten system — hence the absence of zero and a different logic from Hindu–Arabic digits.
Stephen Chrisomalis in Numerical Notation: A Comparative History places Roman numerals among cumulative–additive systems with later subtractive rules. Subtractive spelling was not uniform from the start: inscriptions and medieval manuscripts show additive forms (IIII, VIIII) beside subtractive ones (IV, IX). The modern schoolbook set of six subtractive pairs is a didactic and typographic convention solidified in print culture and schooling — and that is the convention this page implements.
Tower and dial clocks often keep IIII instead of IV: explanations range from visual balance against VIII, to workshop tradition, to avoiding a form associated with Jupiter (IVPITER) in some accounts — whatever the cause, clockmaker IIII is not canonical here. In film, monuments, and papal names (John Paul II as Ioannes Paulus II) Roman numerals today serve symbolic and stylistic roles rather than everyday arithmetic.
Let T be the ordered list of (value, token) pairs: (1000,M), (900,CM), (500,D), (400,CD), (100,C), (90,XC), (50,L), (40,XL), (10,X), (9,IX), (5,V), (4,IV), (1,I). For n ∈ {1,…,3999} the greedy algorithm builds a unique string R(n) by appending tokens until the summed value equals n. The inverse: scanning string s with tokens from T left to right yields sum σ(s); acceptance requires σ(s) ∈ [1,3999] and R(σ(s)) = s (after uppercase and space stripping).
Properties: R is injective and surjective onto its image; |R(n)| is bounded (the longest canonical strings in this range are on the order of a dozen characters, e.g. MMMCMXCIX). Tokens V, L, and D never repeat in R(n); I, X, C, and M repeat at most three times in a row in additive stretches. Each subtractive pair appears at most once per decimal “column.”
The system is not positional: a mark’s meaning does not depend on a base power by place, but on local neighborhood rules (add / subtract). There is therefore no direct analogue of a decimal place shift.
Step 1 (Arabic → Roman). Input: integer n with 1 ≤ n ≤ 3999. Remainder r ← n, output w ← empty. For each (v, t) in T: while r ≥ v, append t to w and set r ← r − v. Output: w. Example n = 2026: M, M, X, X, V, I → MMXXVI.
Step 2 (Roman → Arabic). Input: string s. Normalize: uppercase, strip spaces. Reject if any character is outside MDCLXVI. Index i ← 0, sum σ ← 0. For each (v, t) in T: while s matches t at i, set σ ← σ + v and i ← i + |t|. If i ≠ |s|, reject. If σ ∉ [1,3999] or R(σ) ≠ s, reject. Otherwise the result is σ.
Step 3 (why canonical validation). A naive sum of IIII would give 4, but R(4) = IV ≠ IIII. A naive IC would give 99, but R(99) = XCIX ≠ IC. Requiring R(σ) = s accepts only strings generated by the same model.
Step 4 (subtractive example). n = 44: XL (40) + IV (4) = XLIV. Tokens XL and IV come from T; XXXXIIII is not produced.
Lower end: 1 → I. Upper end: 3999 → MMMCMXCIX. Round values: 10 → X, 50 → L, 100 → C, 500 → D, 1000 → M, 2000 → MM. Fours and nines in each decade: 4→IV, 9→IX, 40→XL, 90→XC, 400→CD, 900→CM. Year 1990 → MCMXC; 2026 → MMXXVI; 14 → XIV.
Rejected: 0, 4000, −3, 14.5, empty string, “ABC”, “IIII”, “VV”, “IC”, “IL”, “XM”. Lowercase “xiv” is accepted as XIV. Spaces inside “X I V” are stripped before reading.
Vinculum (M with an overline = 1,000,000 in some conventions) and apostrophe/parenthesis thousands notations are unsupported — values beyond 3999 report a range error.
The calculator is integer-only: no fractions appear at any step. Arabic input after comma-to-dot normalization must be a finite whole number (n === ⌊n⌋). Roman reading does not “blind-sum” without the canonical check — a deliberate choice matching schoolbook spelling.
Complexity: with a fixed-length list T and a short string (a dozen characters), runtime is effectively constant. There is no int32 overflow risk in 1–3999.
The result panel shows direction, input echo, subtractive pairs present in the string, and greedy-breakdown chips — the same values as in the algorithm, without a separate visual heuristic.
Related CalcBoxer tools: positional bin/hex/dec (IT), random number generator, decimal-to-fraction. Roman numerals are neither a cipher nor a date calculator — Roman-style calendar dates (day.month.year as three separate numbers) need a separate mode this calculator does not provide.
Sources Menninger, Number Words and Number Symbols; Ifrah, The Universal History of Numbers; Chrisomalis, Numerical Notation; encyclopedic entries Wikipedia EN/PL “Roman numerals” / “Cyfry rzymskie”; school tables of the IV–CM pairs. Educational tool — not a substitute for epigraphic paleography.
2026 is written MMXXVI: two thousand, twenty, and six in tokens M, X, V, I, with subtractive pairs where list T requires them.
MMXXVI
Two Ms (2000), XX (20), VI (6).
XIV
X (10) + IV (4).
14
Canonical reading of XIV.
MMMCMXCIX
Upper bound: MMM+CM+XC+IX.
XLIV
XL (40) + IV (4).
2026
Reading MMXXVI → 2026.
MCMXC
M + CM + XC.
49
XL (40) + IX (9).
The calculator greedily picks tokens from largest to smallest: M (1000), CM (900), D (500), CD (400), C (100), XC (90), L (50), XL (40), X (10), IX (9), V (5), IV (4), I (1). For 2026: MM + XX + VI = MMXXVI. Only whole numbers from 1 to 3999 are allowed.
The input string (uppercase or lowercase I, V, X, L, C, D, M) is scanned with the same tokens from the left. The value must lie in 1–3999 and must equal canonical toRoman(n). That is why IIII, IC, and XXXX fail — 4 is IV, and 99 is XCIX.
Six schoolbook pairs: IV=4, IX=9, XL=40, XC=90, CD=400, CM=900. A smaller mark before a larger one is subtracted. Otherwise the notation is additive: XVII = 10+5+1+1. This calculator uses only those pairs — not rare forms such as IL or IC.
This page covers 1 to 3999 (I through MMMCMXCIX). Classical Roman numerals have no zero symbol. Numbers ≥ 4000 need a vinculum (overline) or other extensions — this calculator does not compute them.
Clock faces often use additive IIII (a clockmaking tradition). The modern schoolbook canonical form for 4 is IV. The calculator accepts only the canonical string equal to toRoman(n), so IIII is rejected.
Yes. xiv and XIV mean the same; spaces are stripped before reading. Other characters (Arabic digits in Roman mode, letters outside MDCLXVI) produce an error.
No. Conversion applies to a whole number alone, not to a day–month–year calendar date. The Caesar substitution cipher is on a separate IT page. 2026 is MMXXVI regardless of the month.
2026 → MMXXVI. 14 → XIV. XIV → 14. 3999 → MMMCMXCIX. The same values appear in the clickable examples and in the result panel.
No. The result depends only on the direction and the value you enter. The currency and unit settings in the page header do not affect this result.
The panel shows the greedy value breakdown (for example 1000+1000+10+10+5+1) as chips M, M, X, X, V, I. That is the same path as toRoman in the code — not a separate visual formula.
History, subtractive convention, and the 1–3999 range draw on established references.
Page updated October 14, 2026.