Roman Numeral Converter

Roman Numeral Converter API

Utilities

Convert numbers to Roman numerals and back as you type, with strict checking that explains mistakes, overline numerals to 3,999,999, and a date converter.

Authentication

All API requests require a valid API key passed in the Authorization header as a Bearer token.

Rate Limit

120 requests per minute

Endpoints

1 endpoint available

Overview

Converts numbers to Roman numerals and back, and writes dates in Roman numerals. It has two operations: convert and date.

convert

  • Send a number (1994, 12,345) to get a numeral, or a numeral (MCMXCIV) to get a number. The direction is detected from the input.
  • Numbers 1 to 3,999 use standard numerals. From 4,000 up to 3,999,999, the thousands are written with a combining overline (U+0305) after each letter, which means times 1,000. The roman field holds this text.
  • Numerals are checked strictly. A non-standard form such as IIII or IC returns a 400 with a plain-English reason and, where possible, details.suggestion with the standard form. Set lenient to true to read it anyway; the response then includes note and standard.
  • Unicode numeral characters and overlined letters are accepted. Letters are case-insensitive.
  • Parts separated by dots or dashes (VII.IV.MMXXIV) are read one by one and returned as parts. Each part has text, value (null when unreadable) and sometimes message.
  • Zero, negative numbers, decimals and numbers above 3,999,999 return a 400.

date

Takes a date as YYYY-MM-DD and writes the month, day and year in Roman numerals, in the order and with the separator you choose. The year must be 1 to 3,999 and the date must exist on the calendar.

Endpoints

POST
https://opentools.ca/api/v1/tools/roman-numeral-converter
Convert numbers, numerals and dates

Request Body

Content-Type: application/json

ParameterTypeRequiredDescription
operation
string
Enum: convert, date
Required
What to do.
input
string
OptionalFor convert (required): a number or a Roman numeral, up to 200 characters.
lenient
boolean
OptionalFor convert: accept non-standard numerals like IIII or IIX.Default: false
date
string
OptionalFor date (required): a date as YYYY-MM-DD.
order
string
Enum: MDY, DMY, YMD
OptionalFor date: the order of month, day and year.Default: MDY
separator
string
Enum: ., ·, •, -, /,
OptionalFor date: the character between the parts.Default: .

Response Example

{
  "success": true,
  "operation": "convert",
  "direction": "numberToRoman",
  "value": 1994,
  "roman": "MCMXCIV",
  "vinculum": false,
  "steps": [
    {
      "value": 1000,
      "roman": "M",
      "over": false
    },
    {
      "value": 900,
      "roman": "CM",
      "over": false
    },
    {
      "value": 90,
      "roman": "XC",
      "over": false
    },
    {
      "value": 4,
      "roman": "IV",
      "over": false
    }
  ]
}

Error Codes

400
Bad Request - Missing or invalid fields, a numeral that is not standard (without lenient), a number outside 1 to 3,999,999, or a date that does not exist or has a year outside 1 to 3,999. The reason is in error.
401
Unauthorized - Invalid or missing API key
403
Forbidden - API key is inactive or expired, or the request IP is not allowed for this key
429
Too Many Requests - Rate limit exceeded
500
Internal Server Error

Code Examples

# Number to numeral
curl -X POST https://opentools.ca/api/v1/tools/roman-numeral-converter \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"operation": "convert", "input": "1994"}'

# Numeral to number, accepting IIII
curl -X POST https://opentools.ca/api/v1/tools/roman-numeral-converter \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"operation": "convert", "input": "IIII", "lenient": true}'

# Date to numerals: returns "VII.IV.MMXXIV"
curl -X POST https://opentools.ca/api/v1/tools/roman-numeral-converter \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"operation": "date", "date": "2024-07-04", "order": "MDY", "separator": "."}'

Ready to get started?

Create an API key to start using the Roman Numeral Converter API.

Rather use it in your browser? Open the Roman Numeral Converter