Bookmarks    
nPr and nCr    
Random Number    
SD Calculator    
Sample Size    
Percent Error    
Density    
Molarity    
Molar Mass    
Ohm's Law    
Watts to Amps    
Voltage Drop    
Long Division    
Mixed Numbers    
Rounding    
Nth Root    
Exponents    
Half-Life    
Polar Form    
De Moivre    
3D Distance    
Point to Line    
Cross Product    
Determinant    
Sin Cos Tan    
Triangle Area    
Scale Factor    
Sector Area    
Ellipse Area    
Cube Volume    
Box Volume    
Sphere Volume    
Cone Volume    
Pipe Volume    
Time Duration    
Time Card    
Present Value    
Future Value    
Churn Rate    
A/B Test Calc    
SEO Traffic    
Ideal Weight    
Fat Intake    
Child Height    
Golf Handicap    
Heat Index    
Wind Chill    
Dew Point    
Download Time    
kWh to Cost    
AC Size (BTU)    
Heating Costs    
LED Savings    
Trip Gas Cost    
Tire Size    
Solar Output    
Solar Payback    
Battery Size    
Wall Area    
Gravel Needed    
Mortar Mix    
Slope Grade    
Curtain Size    
Soil Needed    
Sod Needed    
Ramp Length    
Blind Size    
Drain Slope    
Board Feet    
Heat Loss    
Furniture Fit    
Moving Boxes    
Plywood Cuts    
Shelf Sag    
   Add
Probability and random number calculators
Independent Events
Independent Events
Two Events Solver
Two Events Solver
Repeated Trials
Repeated Trials
Bayes' Theorem
Bayes' Theorem
Expected Value
Expected Value
Binomial Distribution
Binomial Distribution
nPr and nCr
nPr and nCr
Circular Permutation
Circular Permutation
With Repetition
With Repetition
Random Number
Random Number
Averages and statistics calculators
Average Calculator
Average Calculator
Mean Median Mode
Mean Median Mode
SD Calculator
SD Calculator
Quartiles & IQR
Quartiles & IQR
Frequency Table
Frequency Table
Correlation (r)
Correlation (r)
Normal Probability
Normal Probability
Z-Score Calculator
Z-Score Calculator
Confidence Interval
Confidence Interval
Sample Size
Sample Size
Mark & Recapture
Mark & Recapture
P-Value Calculator
P-Value Calculator
Percentage and ratio calculators
Percentage Calc
Percentage Calc
Percent Change
Percent Change
Percent Difference
Percent Difference
Percent Error
Percent Error
Ratio Calculator
Ratio Calculator
Discount Calculator
Discount Calculator
Sales Tax Calculator
Sales Tax Calculator
Margin Calculator
Margin Calculator
Speed calculators
Speed Calculator
Speed Calculator
Density and concentration calculators
Density
Density
Molarity
Molarity
Molar Mass
Molar Mass
Physics and electricity calculators
Ohm's Law
Ohm's Law
Watts to Amps
Watts to Amps
Resistor Colors
Resistor Colors
Voltage Drop
Voltage Drop
Unit conversion calculators
Weight Converter
Weight Converter
Shoe Size Converter
Shoe Size Converter
Integer and signed number calculators
Long Division
Long Division
LCM Calculator
LCM Calculator
GCF Calculator
GCF Calculator
Integer Calculator
Integer Calculator
Prime Factorization
Prime Factorization
Diophantine Solver
Diophantine Solver
Modulo Calculator
Modulo Calculator
Factor Calculator
Factor Calculator
Roman Numerals
Roman Numerals
Fraction, decimal and rounding calculators
Fraction Calculator
Fraction Calculator
Mixed Numbers
Mixed Numbers
Simplify Fractions
Simplify Fractions
Fraction to Decimal
Fraction to Decimal
Decimal to Fraction
Decimal to Fraction
Rounding
Rounding
Equation and inequality calculators
Linear Equation
Linear Equation
Linear Systems
Linear Systems
Quadratic Formula
Quadratic Formula
Absolute Value
Absolute Value
Quadratic Inequality
Quadratic Inequality
Polynomial calculators
Binomial Theorem
Binomial Theorem
Square root and nth root calculators
Simplify Radicals
Simplify Radicals
Nth Root
Nth Root
Exponent and logarithm calculators
Exponents
Exponents
Log Calculator
Log Calculator
Number of Digits
Number of Digits
Scientific Notation
Scientific Notation
Sci. Notation Math
Sci. Notation Math
Half-Life
Half-Life
Complex number calculators
Complex Numbers
Complex Numbers
Polar Form
Polar Form
De Moivre
De Moivre
Function and graph calculators
Slope Calculator
Slope Calculator
Linear Function
Linear Function
Direct & Inverse Variation
Direct & Inverse Variation
y = ax² Calculator
y = ax² Calculator
Distance Formula
Distance Formula
3D Distance
3D Distance
Section Formula
Section Formula
Point to Line
Point to Line
Lat/Long Distance
Lat/Long Distance
Complete the Square
Complete the Square
Circle Equation
Circle Equation
Conic Sections
Conic Sections
Polar Coordinates
Polar Coordinates
Sequence calculators
Arithmetic Sequence
Arithmetic Sequence
Geometric Sequence
Geometric Sequence
Fibonacci Sequence
Fibonacci Sequence
Recurrence Relation
Recurrence Relation
Vector calculators
Vector Calculator
Vector Calculator
Cross Product
Cross Product
Matrix calculators
Matrix Calculator
Matrix Calculator
Determinant
Determinant
Inverse Matrix
Inverse Matrix
Plane geometry calculators
Sin Cos Tan
Sin Cos Tan
Degrees ⇔ Radians
Degrees ⇔ Radians
a sin θ + b cos θ
a sin θ + b cos θ
Triangle Solver
Triangle Solver
Triangle Area
Triangle Area
Right Triangle
Right Triangle
Pythagorean Theorem
Pythagorean Theorem
Polygon Angles
Polygon Angles
Scale Factor
Scale Factor
Parallel Lines
Parallel Lines
Rectangle Area
Rectangle Area
Parallelogram Area
Parallelogram Area
Trapezoid Area
Trapezoid Area
Circle Calculator
Circle Calculator
Sector Area
Sector Area
Inscribed Angle
Inscribed Angle
Ellipse Area
Ellipse Area
Solid geometry calculators
Cube Volume
Cube Volume
Cube Surface Area
Cube Surface Area
Box Volume
Box Volume
Box Surface Area
Box Surface Area
Cylinder Volume
Cylinder Volume
Cylinder Surface
Cylinder Surface
Sphere Volume
Sphere Volume
Sphere Surface
Sphere Surface
Spherical Cap Volume
Spherical Cap Volume
Cap Surface Area
Cap Surface Area
Ellipsoid Volume
Ellipsoid Volume
Ellipsoid Surface
Ellipsoid Surface
Pyramid Volume
Pyramid Volume
Pyramid Surface
Pyramid Surface
Cone Volume
Cone Volume
Cone Surface Area
Cone Surface Area
Frustum Volume
Frustum Volume
Frustum Surface Area
Frustum Surface Area
Pipe Volume
Pipe Volume
Capsule Volume
Capsule Volume
Capsule Surface Area
Capsule Surface Area
Date and time calculators
Age Calculator
Age Calculator
Days Between Dates
Days Between Dates
Date Calculator
Date Calculator
Hours From Now
Hours From Now
Day of the Week
Day of the Week
Time Calculator
Time Calculator
Time Zone Converter
Time Zone Converter
Hours Calculator
Hours Calculator
Time Duration
Time Duration
Time Card
Time Card
Finance and economics calculators
Compound Interest
Compound Interest
Simple Interest
Simple Interest
Interest Calculator
Interest Calculator
TVM Calculator
TVM Calculator
Present Value
Present Value
Future Value
Future Value
ROI Calculator
ROI Calculator
IRR Calculator
IRR Calculator
Payback Period
Payback Period
Average Return
Average Return
GDP Calculator
GDP Calculator
Web marketing and ad metric calculators
CTR Calculator
CTR Calculator
Conversion Rate
Conversion Rate
CPC, CPM & CPA
CPC, CPM & CPA
ROAS Calculator
ROAS Calculator
Break-Even CPA
Break-Even CPA
LTV Calculator
LTV Calculator
CAC Calculator
CAC Calculator
Churn Rate
Churn Rate
A/B Test Calc
A/B Test Calc
A/B Sample Size
A/B Sample Size
SEO Traffic
SEO Traffic
Break-Even Point
Break-Even Point
Markup vs. Margin
Markup vs. Margin
CAGR Calculator
CAGR Calculator
Health and fitness calculators
BMI Calculator
BMI Calculator
Sleep Calculator
Sleep Calculator
Calorie Calculator
Calorie Calculator
BMR Calculator
BMR Calculator
TDEE Calculator
TDEE Calculator
Ideal Weight
Ideal Weight
Body Fat Calculator
Body Fat Calculator
Lean Body Mass
Lean Body Mass
Calories Burned
Calories Burned
Protein Intake
Protein Intake
Macro Calculator
Macro Calculator
Carb Calculator
Carb Calculator
Fat Intake
Fat Intake
Child Height
Child Height
Sports calculators
Golf Handicap
Golf Handicap
Pace Calculator
Pace Calculator
1RM Calculator
1RM Calculator
Target Heart Rate
Target Heart Rate
Weather calculators
Heat Index
Heat Index
Wind Chill
Wind Chill
Dew Point
Dew Point
Computer calculators
Base Converter
Base Converter
Subnet Calculator
Subnet Calculator
Download Time
Download Time
Household energy and budget calculators
Electricity Cost
Electricity Cost
kWh to Cost
kWh to Cost
Yearly kWh to Cost
Yearly kWh to Cost
AC Size (BTU)
AC Size (BTU)
AC Running Cost
AC Running Cost
Heating Costs
Heating Costs
Gas vs Electric
Gas vs Electric
LED Savings
LED Savings
Salary Calculator
Salary Calculator
Budget Calculator
Budget Calculator
Car calculators
Trip Gas Cost
Trip Gas Cost
EV Charging Cost
EV Charging Cost
EV vs Gas Cost
EV vs Gas Cost
MPG Calculator
MPG Calculator
Tire Size
Tire Size
Solar power and battery calculators
Solar Output
Solar Output
Solar Panel Count
Solar Panel Count
Solar Payback
Solar Payback
Battery Size
Battery Size
Home and DIY calculators
Tile Calculator
Tile Calculator
Stair Calculator
Stair Calculator
Concrete Volume
Concrete Volume
Wall Area
Wall Area
Wallpaper Rolls
Wallpaper Rolls
Paint Calculator
Paint Calculator
Flooring Needed
Flooring Needed
Exterior Walls
Exterior Walls
Gravel Needed
Gravel Needed
Mortar Mix
Mortar Mix
Slope Grade
Slope Grade
Lumber Cut List
Lumber Cut List
Lot Coverage/FAR
Lot Coverage/FAR
Sheet Vinyl Roll
Sheet Vinyl Roll
Insulation Needed
Insulation Needed
Curtain Size
Curtain Size
TV Size & Distance
TV Size & Distance
Soil Needed
Soil Needed
Sod Needed
Sod Needed
Block Calculator
Block Calculator
Brick Calculator
Brick Calculator
Deck Materials
Deck Materials
Ramp Length
Ramp Length
Pilot Hole Size
Pilot Hole Size
Room Ventilation
Room Ventilation
Paint Thinning
Paint Thinning
Baseboard & Trim
Baseboard & Trim
Blind Size
Blind Size
Picture Hanging
Picture Hanging
Drain Slope
Drain Slope
Screw Calculator
Screw Calculator
Board Feet
Board Feet
Fence Calculator
Fence Calculator
Wood Shrinkage
Wood Shrinkage
Caulk Calculator
Caulk Calculator
Heat Loss
Heat Loss
Furniture Fit
Furniture Fit
Moving Boxes
Moving Boxes
Storage Capacity
Storage Capacity
Plywood Cuts
Plywood Cuts
Shelf Sag
Shelf Sag

Roman Numeral Converter (Numbers to Roman Numerals and Back)

Enter either a number (in Arabic numerals) or a Roman numeral. The page tells which one it is and converts it the other way, with a breakdown such as 1000 + 900 + 90 + 4.

Integers from 1 to 3,999,999 are supported. Numbers of 4,000 or more become Roman numerals with a bar on top (a vinculum). To type a barred symbol, put an underscore in front, as in "_M" (you can also copy and paste from the result). Nonstandard forms such as IIII can be read too.
Result
Enter a number or a Roman numeral in the field on the left and press "Calculate". The result and a step-by-step breakdown will appear here.

What you can do on this page

  • Convert either way with a single input field: "What is 1994 in Roman numerals?" or "What number is MCMXCIV?" (the page tells automatically whether you entered a number or a Roman numeral)
  • A step-by-step breakdown such as 1000 + 900 + 90 + 4 → M + CM + XC + IV shows you how the conversion works, so you learn to do it yourself
  • Read the Roman numerals you see on clock faces, in movie and game sequel numbers, in Olympic and Super Bowl numbers and more, right away
  • Numbers of 4,000 or more are converted to Roman numerals with a bar on top (a vinculum). You can type a barred symbol with an underscore, up to 3,999,999
  • Nonstandard forms such as IIII, common on clock faces, are read too, and the standard form (IV) is shown alongside
Integers from 1 to 3,999,999 are supported. Roman numerals have no way to write 0, negative numbers or decimals.

What is this calculation used for?

Reading clock faces (and the mystery of IIII)

The most common place to see Roman numerals is the face of a watch or a wall clock. XII is 12 o'clock, III is 3 o'clock and IX is 9 o'clock: once you know the subtractive rule, you can read them all.
Look closely, and many clocks show 4 o'clock as IIII instead of the standard IV. This is a traditional nonstandard form with several proposed explanations, such as "it balances the left and right sides of the dial" or "it avoids IV, the start of the god Jupiter's name in Latin (IVPPITER)". It lives on today as an exception to the rules.

Reading sequel numbers in movies and games

"Rocky IV" is the 4th movie, "Final Fantasy VII" is the 7th game and "Star Wars: Episode IV" is the 4th episode: Roman numerals are widely used to number sequels.
Beyond X they get harder to read, as in "XIII" (the 13th), but if you know the subtractive rule, you will not get lost. Reading the numbers in titles at a glance is a nice bit of general knowledge.

Numbering the Olympics and the Super Bowl

Big international competitions use Roman numerals for their numbers. The 2024 Paris Olympics were officially the "Games of the XXXIII Olympiad" (the 33rd), and the Super Bowl, the biggest yearly game in American sports, is written like "Super Bowl LVIII" (the 58th, in 2024).
When you see this on the news or on a poster, you can work it out: XXXIII = 10 + 10 + 10 + 1 + 1 + 1 = 33.

Reading the numbers of kings, queens and popes

The numbers of European monarchs and popes are written in Roman numerals: Queen Elizabeth II, Louis XIV of France (the "Sun King") and Pope John Paul II.
When you meet a name like "Henry VIII" in a history book, in the news or on a commemorative coin, you can read it correctly: VIII = 5 + 1 + 1 + 1 = 8.

Years in movie credits and on cornerstones

At the very end of a movie's credits, the year it was made is sometimes given in Roman numerals, such as "MMXXVI" (2026). Cornerstones and monuments on buildings in the US and Europe also traditionally carry the year of completion in Roman numerals.
For example, MCMLXIV is 1000 + 900 + 60 + 4 = 1964, the year the Civil Rights Act was signed in the United States. Even a long year can be read correctly if you split it into chunks, M, CM, LX, IV, and add them up.

Formula

Number → Roman numeral (breaking it down greedily)
Standard notation (the usual math form)
\(N\) \(=\) \(v_1\) \(+\) \(N_1\)
In words (symbols replaced with words)
① \(N\): number to convert \(=\) ② \(v_1\): largest value that fits \(+\) ③ \(N_1\): what is left
The formula in words
① From the \(N\): number to convert
② subtract the \(v_1\): largest value that fits (chosen from 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1) and write down its symbol (M, CM, D, CD, C, XC, L, XL, X, IX, V, IV, I)
③ Repeat the same with \(N_1\): what is left until it reaches 0. The symbols you wrote, placed from left to right, are the Roman numeral
Quick example
Converting 1994 to Roman numerals (taking the largest value that fits each time breaks it into 1000 → 900 → 90 → 4)
number to convert (1994) \(=\) 1000 (M) \(+\) 900 (CM) \(+\) 90 (XC) \(+\) 4 (IV)
\(1994 = 1000 + 900 + 90 + 4\)
\(\mathrm{M} + \mathrm{CM} + \mathrm{XC} + \mathrm{IV} = \mathrm{MCMXCIV}\)
Key idea
A "greedy algorithm" is a method that always picks the largest value available at that moment. It is the same idea as paying 94 cents with the fewest coins: first quarters (3 of them, 75 cents), then a dime (85), then a nickel (90), then pennies (4 of them, 94). If you also put the subtractive pairs 900 (CM), 400 (CD), 90 (XC), 40 (XL), 9 (IX) and 4 (IV) in the table and pick in the same way, you always get the one standard Roman numeral. For numbers above 3,999 (MMMCMXCIX), a bar over a symbol (a vinculum) multiplies it by 1,000 (for example, \(\overline{\mathrm{X}}\) = 10,000). On this page you can type a barred symbol with an underscore, as in "_X".
Roman numeral → number (the subtractive rule)
Standard notation (the usual math form)
\(N\) \(=\) \(\displaystyle\sum_{i=1}^{k}\) \(\pm\, v_i\)
In words (symbols replaced with words)
③ \(N\): value in Arabic numerals \(=\) ② \(\displaystyle\sum\): add them all ① \(v_i\): value of each symbol
The formula in words
① Read the symbols from left to right and take the \(v_i\): value of each symbol (minus if the next symbol is larger, plus otherwise)
② then \(\displaystyle\sum\): add them all
③ and you get the \(N\): value in Arabic numerals
Quick example
Converting MCMXCIV to a number (the C before M, the X before C and the I before V are each followed by a larger symbol, so they are minus)
\(N\): value in Arabic numerals \(=\) 1000 − 100 + 1000 − 10 + 100 − 1 + 5
\(1000 - 100 + 1000 - 10 + 100 - 1 + 5 = 1994\)
Key idea
There are four rules for reading and writing Roman numerals. (1) Write the symbols from largest to smallest, left to right, and add their values (LXIII = 50 + 10 + 3 = 63). (2) The same symbol can appear at most 3 times in a row (4 is IV, not IIII). (3) A smaller symbol placed before a larger one is subtracted (subtractive notation). Only I, X and C are used this way: I only before V and X, X only before L and C, and C only before D and M (49 cannot be written IL; it is XLIX). (4) V, L and D are never repeated and never subtracted. On clock faces, however, IIII is traditionally used, even though it breaks rule (2) (one popular explanation is that it looks more balanced on the dial). The calculator on this page reads such nonstandard forms too and shows the standard form alongside.
Roman numeral conversion works in two directions. From a number to a Roman numeral, subtract the values in the table from largest to smallest (a greedy algorithm). From a Roman numeral to a number, add up the values of the symbols, but subtract any symbol that is followed by a larger one (the subtractive rule). The seven basic symbols can write numbers up to 3,999; larger numbers use a bar on top (a vinculum) to multiply by 1,000.

Symbols and terms

Symbols

I one The symbol for 1. It is thought to come from the shape of one finger. I = 1, II = 2, III = 3.
V five The symbol for 5. One theory says it comes from the shape of an open hand (five fingers).
X ten The symbol for 10. One theory says it is two V's (5) joined together.
L fifty The symbol for 50.
C one hundred The symbol for 100. It is thought to be the first letter of the Latin centum (100), the same root as "cent" (1/100 of a dollar) and "century" (100 years).
D five hundred The symbol for 500. One theory says it comes from the right half of an old symbol for 1000.
M one thousand The symbol for 1000. It is thought to be the first letter of the Latin mille (1000), the same root as "millimeter" (1/1000 of a meter) and "mile" (originally 1,000 Roman paces).
X̅ ten thousand (X with a bar) A bar over a symbol (a vinculum) multiplies its value by 1,000. X̅ is 10 × 1000 = 10,000. On this page you type it with an underscore, as in "_X".

Terms

Roman numerals A way of writing numbers born in ancient Rome, using combinations of seven symbols, I, V, X, L, C, D and M. There is no place value; a number is written by adding and subtracting the values of the symbols. There is no symbol for 0.
Arabic numerals The everyday way of writing numbers with the ten digits 0 to 9. They were born in India and reached Europe through the Arab world, which is why they are also called Hindu-Arabic numerals. They use place value, so the same "9" is worth 9, 90 or 900 depending on where it is written.
subtractive notation Writing a smaller symbol before a larger one to show subtraction. Only six pairs are standard, IV (4), IX (9), XL (40), XC (90), CD (400) and CM (900). It avoids writing the same symbol four times in a row.
greedy algorithm A method that always picks the largest option available at that moment. It is one of the basic ideas in programming. Converting a number to Roman numerals this way always gives the standard form.
vinculum A bar drawn over symbols (Latin for "bond" or "tie"). A barred symbol is worth 1,000 times its usual value, so numbers of 4,000 or more, which the seven basic symbols cannot write, can be written. This page supports numbers up to 3,999,999.
nonstandard form A way of writing that does not follow the standard rules but has long been in wide use. The best-known example is IIII on clock faces (standard form IV), sometimes called the "watchmaker's four". The calculator on this page reads nonstandard forms too and shows the standard form alongside.

Good to know before you start

Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.

Addition and subtraction (Grades 1–3)
  • Being able to add correctly, as in 1000 + 900 + 90 + 4
  • Being able to find the difference of two numbers, as in 5 − 1 = 4 (subtractive notation is this subtraction)
Place value in base ten (elementary school)
  • Being able to break 1994 into "1 thousand, 9 hundreds, 9 tens and 4 ones"
  • Seeing the difference: in Arabic numerals a digit is worth more or less depending on its position (place value), while in Roman numerals each symbol has a fixed value wherever it is
Breaking an amount into the largest pieces first (elementary school, money)
  • Being able to pay 94 cents starting with the largest coins: 3 quarters, 1 dime, 1 nickel and 4 pennies (the same idea as the greedy algorithm)

How to calculate it in Excel

Copy the whole table below and paste it into cell A1 in Excel. It works as is.
Table to convert a number to Roman numerals
Arabic numerals 1994
Roman numerals =ROMAN(B1)
Table to convert Roman numerals to a number
Roman numerals MCMXCIV
Arabic numerals =ARABIC(B1)
In the first table, enter a number in B1 and B2 shows it in Roman numerals (MCMXCIV for 1994). The ROMAN function works from 0 to 3,999: 0 gives an empty result, and negative numbers or 4,000 and above give an error (the barred vinculum form is not supported).
In the second table, enter a Roman numeral in B1 and B2 shows the number (1994 for MCMXCIV). The ARABIC function also accepts lower case (mcmxciv).

How to calculate it in Google Sheets

Copy the whole table below and paste it into cell A1 in Google Sheets. It works as is.
Table to convert a number to Roman numerals
Arabic numerals 1994
Roman numerals =ROMAN(B1)
Table to convert Roman numerals to a number
Roman numerals MCMXCIV
Arabic numerals =ARABIC(B1)
The same ROMAN and ARABIC functions as in Excel work as is. Copy the whole table, paste it into cell A1, and replace B1 with your own value.
The upper limit of ROMAN is 3,999, the same as in Excel, but Google Sheets converts only 1 to 3,999: 0 gives an error.

How to calculate it in Python

value = "1994"   # the value to convert (a number or a Roman numeral)

# table for the greedy algorithm (largest first; subtractive pairs such as 900=CM are included)
VALUES = [(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")]

def to_roman(n):
    # number -> Roman numeral (replace with symbols, taking the largest value that fits each time)
    result = ""
    for v, symbol in VALUES:
        while n >= v:
            result += symbol
            n -= v
    return result

SYMBOL_VALUES = {"I": 1, "V": 5, "X": 10, "L": 50, "C": 100, "D": 500, "M": 1000}

def to_arabic(roman):
    # Roman numeral -> number (subtract when the next symbol is larger)
    total = 0
    for i, ch in enumerate(roman):
        v = SYMBOL_VALUES[ch]
        if i + 1 < len(roman) and SYMBOL_VALUES[roman[i + 1]] > v:
            total -= v
        else:
            total += v
    return total

s = value.strip().upper()
if s.isdigit():
    print(f"{s} = {to_roman(int(s))}")
else:
    print(f"{s} = {to_arabic(s)}")
Runs with the standard library only. to_roman is the greedy algorithm (replace with symbols, taking the largest value that fits each time), and to_arabic is the subtractive rule (subtract when the next symbol is larger). This code is for the seven basic symbols (1 to 3,999) and does not handle the barred vinculum form. Change value at the top and run it.

How to write it in LaTeX and other math languages (copy and paste)

Number → Roman numeral (breaking it down greedily)
N = v₁ + v₂ + ⋯ + vₖ
N = v_1 + v_2 + \cdots + v_k
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>N</mi>
    <mo>=</mo>
    <msub><mi>v</mi><mn>1</mn></msub>
    <mo>+</mo>
    <msub><mi>v</mi><mn>2</mn></msub>
    <mo>+</mo>
    <mo>&#x22EF;</mo>
    <mo>+</mo>
    <msub><mi>v</mi><mi>k</mi></msub>
  </mrow>
</math>
N = v_1 + v_2 + cdots + v_k
RomanNumeral[1994]
convert(1994, roman);
N = sum([1000 900 90 4]);
N = v_1 + v_2 + ⋯ + v_k
Roman numeral → number (the subtractive rule)
N = Σ ±vᵢ
N = \sum_{i=1}^{k} \pm v_i
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>N</mi>
    <mo>=</mo>
    <munderover>
      <mo>&#x2211;</mo>
      <mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow>
      <mi>k</mi>
    </munderover>
    <mo>&#xB1;</mo>
    <msub><mi>v</mi><mi>i</mi></msub>
  </mrow>
</math>
N = sum_(i=1)^k +-v_i
FromRomanNumeral["MCMXCIV"]
convert("MCMXCIV", arabic);
N = 1000 - 100 + 1000 - 10 + 100 - 1 + 5;
N = ∑_(i=1)^k ±v_i

How to have ChatGPT  do the calculation

You are a calculation assistant for Roman numeral conversion. Do the following conversions by actually running Python code, and base your answer only on the execution result (do not answer by mental math or guessing).

1. Convert 1994 to Roman numerals.
2. Convert the Roman numeral MCMXCIV to a number.
3. Convert 2026 to Roman numerals.

For the conversions from numbers, also show how the value breaks down, as in 1994 = 1000 + 900 + 90 + 4.
Show the code you used and the execution result.

How to Use
  1. 1
    Enter your numbers
    Type the numbers you want to calculate with into the input fields
  2. 2
    Calculate
    Press the "Calculate" button
  3. 3
    Check the result
    The result appears on the spot. The same page also explains the idea behind the calculation and the formula
  DataChef Features
Easy and Free
Unlimited conversions for free.
No technical knowledge required.
Intuitive and user-friendly operation.
No Registration Required
Available immediately after access.
Can be used without registering personal information.
Safe and Secure
Fully SSL encrypted communication.
Automatic file deletion by clicking "download".
Fast
High-speed site access
and rapid file conversion.
No Watermark
No watermark.
No attribution required.
Commercial Use Available
Free for commercial use.
No need to contact us for commercial use permission.