Roman Numeral Converter
Convert Roman numerals to numbers and back — 1 to 3,999 in standard form, entirely on this device.
Adds an overline (×1,000) so values above 3,999 can be read and written. Overlined numerals are non-standard.
Press ? for shortcuts
Do it offline:$ node -e "const t=[[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']];let x=+process.argv[1],r='';for(const[v,s]of t)while(x>=v){r+=s;x-=v}console.log(r)" 2024
How to use it
- Type a value. Digits like 2024 become a numeral, letters like MMXXIV become a number, and a badge names the detected direction you can override.
- Read the result beside your input and copy its canonical spelling. A chip appears when the reader fixes the case or drops a separator.
- Press the swap control, or the s key, to move the result into the input and reverse the direction in one step.
- Above 3,999, turn on overline mode: each barred letter counts a thousand, up to 3,999,999, and a chip flags it as non-standard.
Type a whole number to read its Roman numeral, or paste a numeral such as MMXXIV to read the number back — the page detects the direction and lets you flip it. Roman numerals are additive with a subtractive shorthand, so they carry no zero and no negatives. Standard form spans 1 to 3,999; overline mode extends it to 3,999,999. Whatever you enter is converted in the page, never uploaded.
How it works
Encoding walks a fixed value-to-letter table from the top down — 1000 M, 900 CM, 500 D, 400 CD, 100 C, 90 XC, 50 L, 40 XL, 10 X, 9 IX, 5 V, 4 IV and 1 I — subtracting each value as often as it fits. The six two-letter entries (CM, CD, XC, XL, IX and IV) are the subtractive pairs that let a smaller letter lead a larger one, and taking the largest value each step gives the one canonical spelling.
Reading folds the numeral left to right — a letter subtracts when a larger one follows, otherwise adds — then re-encodes the total; a mismatch means non-standard input, refused. Each letter names only a quantity to add or subtract, so nothing marks an empty column: there is no zero and the count starts at I. A letter repeats three times at most, capping standard form at 3,999, while an overline reaches 3,999,999.
Examples
2024MMXXIVTwo Ms for two thousand, XX for twenty, IV for four — the year as MMXXIV, with no separator or case to resolve.
1994MCMXCIVM for a thousand, CM for nine hundred, XC for ninety, IV for four: three subtractive pairs stacked into MCMXCIV, with no repeats.
MCMLXXXIV1984Reversed — M is 1,000, CM is 900, LXXX is eighty, IV is four — folding left to right to reach 1984.
4IVThe first value needing subtraction: one before five is written IV, not a run of Is — the smallest numeral to use the shorthand.
Every example on this page is executed against the same engine that powers the tool, on every build.
Gotchas worth knowing
Only six subtractive pairs are legal
A smaller letter leads a larger one only in IV, IX, XL, XC, CD and CM. Forms such as IL, IC or VX are refused.
A letter repeats at most three times
III, XXX, CCC and MMM are fine; a fourth in a row is not, so four is IV and MMMM spills past standard form. V, L and D never repeat.
No zero, no negatives, no fractions
Counting starts at one, so zero and negatives are refused and a decimal point halts the conversion. There is no symbol for none.
Past 3,999, switch on the overline
Plain letters stop at MMMCMXCIX, which is 3,999. Overline mode bars a letter to multiply it by a thousand, so 4,000 becomes I̅V̅ and the ceiling reaches 3,999,999.
Lower-case input is read and tidied
Enter xiv and the reader returns 14, read as XIV because numerals are conventionally capitals. A mix like McMlXxXiV works too.
Thousands separators drop out of numbers
On the number side a comma, underscore or space is stripped and counted in a chip, so 2,024 and 2_024 both reach MMXXIV. A numeral carries none, so a space in it is an unexpected symbol.
Common errors
`IIII` is not a standard Roman numeral — 4 is written IV- Four ones in a row is the classic non-standard spelling; the reader folds it to 4 and shows the canonical form IV.
Standard Roman numerals stop at 3,999 (MMMCMXCIX). Turn on overline mode for up to 3,999,999.- A fourth M would mean four thousand, past the standard ceiling; the message points at overline mode, which carries the thousands on a bar.
Roman numerals start at 1 (I) — there is no zero or negative value.- Zero has no numeral of its own, so the page declines it rather than returning a blank answer. The same line covers any value below one.
Roman numerals are whole numbers only — `3.5` has a fractional part- The decimal point is marked where the value stops being whole. A numeral cannot express a fraction, so the tool declines rather than rounding 3.5.
FAQ
How do I write 2024 in Roman numerals?
2024 is MMXXIV — two Ms for two thousand, XX for twenty and IV for four. The other direction turns MMXXIV back into 2024.
Why is there no zero in Roman numerals?
The notation predates positional systems, where a zero fills an empty column. Each Roman letter names a fixed quantity, only added or subtracted, so an empty column never needs a sign.
What is the largest Roman numeral?
In plain letters it is MMMCMXCIX, or 3,999, since no letter repeats a fourth time. Overline mode raises the ceiling to 3,999,999 by barring the thousands, ending in CMXCIX for the final 999.
Keyboard shortcuts
- ⌘/Ctrl + Enter
- Convert the current input again without touching it.
- ⌘/Ctrl + S
- Save the result to a .txt file.
- ⌘/Ctrl + C
- Copy the whole result while no text is selected.
- ⌘/Ctrl + Shift + C
- Copy the result even when a selection exists.
- s
- Swap the two sides, sending the result back as input (idle in text fields).
- t
- Step to the next theme unless you are typing.
- ? or ⌘/Ctrl + /
- Reveal this shortcut list in an overlay.
- Esc
- Close the open overlay; your input stays put.