Number Base & Roman Converter API

Convert integers of any size between bases 2–36 (binary, octal, decimal, hex, base36) and Roman numerals, with grouped binary and hex output.

GETPOSThttps://apibox.io.vn/v1/base-convert
Developer utilities▶ Try it online

The base conversion API converts an integer between any bases from 2 to 36 and Roman numerals. Input is detected automatically (0x hex, 0b binary, 0o octal, Roman letters, otherwise decimal) or set with from; underscores and spaces are ignored and negative numbers are allowed. Numbers of any size are supported (no 2^53 limit), which is useful for IDs, hashes and big counters.

By default the result is given in binary, octal, decimal, hexadecimal, base36 and Roman numerals; to=2,16,roman selects the targets. The response also contains grouped binary (nibbles), upper-case hex with prefix, the decimal with thousands separators and the number of bits and bytes needed.

Roman numerals follow the standard subtractive form (IV, IX, XL, CM) from I to MMMCMXCIX (3,999); invalid forms such as IIII or VX are rejected.

Parameters

NameInTypeRequiredDefault
valuequery|bodystringyesThe number (e.g. 255, 0xFF, 0b1010, MMXXVI).
fromquery|bodystringnoautoauto, roman or a base 2–36.
toquery|bodystringnoTargets, e.g. 2,16,roman (default: 2, 8, 10, 16, 36, roman).

Example

curl "https://apibox.io.vn/v1/base-convert?value=MMXXVI" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "input": "MMXXVI",
  "from": "roman",
  "decimal": "2026",
  "results": {
    "base2": "11111101010",
    "base8": "3752",
    "base10": "2026",
    "base16": "7ea",
    "base36": "1ka",
    "roman": "MMXXVI"
  },
  "formatted": {
    "binary": "111 1110 1010",
    "hex": "0x7EA",
    "grouped": "2,026"
  },
  "bits": 11,
  "bytes": 2
}

Use cases

  • Developer tools: bit masks, colour values, memory addresses
  • Short IDs in base36
  • Teaching number systems
  • Roman numerals for chapters, years and clocks

FAQ

Is there a size limit?

Up to 2,000 characters of input; arithmetic uses big integers, so no precision is lost.

Are fractions supported?

No, integers only.

Why is roman null?

Roman numerals only exist for 1–3,999 in the standard notation.

Related APIs

Start with 1,000 free requests every month. Get free API key →