NewAPIVerve Academy: free courses and certifications anyone can verify.Explore the Academy →

Roman Numeral Math API

GET

Add, subtract, multiply, and divide Roman numerals directly.

Roman Numeral Math computes addition, subtraction, multiplication, and division between two Roman numerals. It returns the calculated result and complete equation in both Roman numeral and standard integer formats.

Try it — live request, no key required

Request
GETapi.apiverve.com/v1/romannumeralmath?roman1=XIV&roman2=VI
Query parameters
Verification
Format

No key required to try it. Get a key to use it in your app.

Example
{
  "status": "ok",
  "error": null,
  "data": {
    "roman1": "XIV",
    "roman2": "VI",
    "roman1_value": 14,
    "roman2_value": 6,
    "operation": "add",
    "result_number": 20,
    "result_roman": "XX",
    "equation_numeric": "14 + 6 = 20",
    "equation_roman": "XIV + VI = XX"
  }
}

About the Roman Numeral Math API

Roman Numeral Math lets you add, subtract, multiply and divide Roman numerals without writing the conversion yourself. Send two numerals and an operation and get back the answer as a Roman numeral and as a number, plus the full equation written both ways, such as XIV + IX = XXIII next to 14 + 9 = 23.

It suits Roman arithmetic exercises in education apps, history and puzzle games, clock and date features that display Roman numerals, and anyone who wants to calculate Roman numerals or add Roman numerals from a spreadsheet or script. Both inputs are checked for proper form first, so a malformed numeral is reported instead of being guessed at.

Everything is available on the Free plan. Each response echoes the two numerals, their numeric values and the operation applied, so the result can be shown with its working. Answers are limited to the range standard Roman numerals can express, and a result outside it returns an explanation rather than an invented numeral.

How it works

roman1 and roman2 are uppercased and then validated against the canonical pattern for numerals from I to MMMCMXCIX: no symbol repeated more than three times in a row and only the six standard subtractive pairs (IV, IX, XL, XC, CD, CM). Forms such as IIII, IC or VV fail with a 400 that names the bad numeral, so both operands are always between 1 and 3999. Each is converted to an integer by a left-to-right scan that subtracts a smaller symbol placed before a larger one.

operation is one of add (the default), subtract, multiply or divide, case-insensitive. Division is integer division rounded down and the remainder is discarded, so XX divided by III returns VI. The integer result is then converted back greedily from the largest value down.

Roman numerals have no zero, no negatives and, in standard form, nothing above 3999. A subtraction that comes to zero or less, or a product or sum above 3999, returns a 400 with a message explaining which limit was hit, rather than a partial result.

On success, result_number and result_roman hold the answer. equation_numeric and equation_roman write out the whole calculation with the operators +, -, × and ÷, using the numerals as you sent them after uppercasing. roman1_value and roman2_value are the parsed operands, which is a convenient way to show a learner what each numeral means.

What people use it for

Educational Tools
Teach Roman numeral arithmetic and ancient mathematics in interactive learning applications
Historical Calculators
Create calculators for historical contexts requiring Roman numeral operations
Puzzle Games
Build mathematical puzzles and games using Roman numeral arithmetic
Format Conversion
Perform calculations while maintaining Roman numeral formatting for specialized applications

Ways to call it

One endpoint, many ways in — REST with JSON, XML, YAML and CSV, plus GraphQL and an MCP interface for AI agents.

JSON
Default REST response
XML
Markup format
YAML
Human-readable
CSV
Tabular export
Beta
GraphQL
Query language
New
MCP
For AI agents

Other ways to use Roman Numeral Math

Same data, same APIVerve account, same credit balance — one key works on all of them.

Questions.

Common questions about the Roman Numeral Math API.

Read the docs →
Which arithmetic operations are supported?
You can perform addition, subtraction, multiplication, and division. Supply two Roman numerals along with the desired operation, and the tool evaluates the math and returns the solved equation.
Does the response include both Roman numerals and standard numbers?
Yes. Every calculation returns the equation and final answer in both Roman numeral notation and standard numeric digits. It also provides the individual integer values for both operands you supplied.
Which plan fits 20,000 Roman numeral calculations a month?
The Starter plan easily covers this volume. At 1 credit per call, 20,000 calculations consume 20,000 credits, using a tenth of Starter's 200,000 monthly credits. That works out to about $0.15 per 1,000 calculations. For testing, the Free plan provides 200 calls per month.
How does the API handle division by zero or out-of-range results?
The API actively validates operands and captures out-of-range results or division by zero. Because traditional Roman numerals have no representation for zero or negative numbers, calculations that produce unsupported values are trapped during calculation rather than returning invalid numerals.
Does Roman Numeral Math validate inputs before performing math?
Yes. Roman Numeral Math validates both input strings to ensure they represent valid Roman numerals before converting them to integers. If an input cannot be parsed into a valid number, the calculation will not proceed.

Ready to build with Roman Numeral Math? Start with 200 free credits — one key unlocks all 300+ APIs.

Explore the catalog

300+ APIs on the same key and the same response shape.

Browse all APIs