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

Number Base Converter API

GET

Convert numbers between binary, hex, and any base up to 36.

Number Base Converter converts numbers between any base from 2 to 36, including binary, octal, decimal, and hexadecimal. Pass a value with optional source and target bases to receive the converted string, base names, and exact decimal values.

Try it — live request, no key required

Request
GETapi.apiverve.com/v1/numberbaseconverter?value=FF
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": {
    "input_value": "FF",
    "input_base": 16,
    "input_base_name": "hexadecimal",
    "decimal_value": 255,
    "decimal_value_exact": "255",
    "output_value": "255",
    "output_base": 10,
    "output_base_name": "decimal"
  }
}

About the Number Base Converter API

A number base converter API for base conversion between any radix from 2 to 36. Send a number and its source base, and either name a target base or leave it out to get the common ones at once. Common conversions include binary to decimal, decimal to binary, hex to decimal and octal to decimal, and the response also labels each base by name so a UI can show "hexadecimal" rather than 16.

Developers use it in calculators and teaching tools, when reading register values and bit masks, when decoding IDs written in base 36, and in data pipelines that receive numbers in mixed formats. Invalid digits for the chosen base are rejected rather than quietly truncated, and very long values are converted digit by digit so they do not lose precision.

Every plan, including the Free plan, gets the same conversion and the same fields.

How it works

The input value is checked against the digits allowed for from before any conversion: base 8 accepts 0 to 7, base 16 accepts 0 to 9 and A to F, and so on up to base 36 with all letters. Letters are case-insensitive and a leading minus sign is allowed. A digit outside the base returns a 400, unlike JavaScript's parseInt, which stops at the first bad character. Both bases must be between 2 and 36; from defaults to 10.

Conversion is done by long division over the digit array instead of through a floating-point number, so results stay exact at any length. decimal_value_exact is the base-10 value as a string and is always exact. decimal_value is the same value as a JSON number for convenience; past 2^53 (9,007,199,254,740,992) it is rounded, so read decimal_value_exact for large inputs.

When to is set, output_value holds the converted digits in upper case, with output_base and output_base_name. Names are binary, octal, decimal and hexadecimal for 2, 8, 10 and 16, and base-N for every other base. When to is omitted, the response has no output_value; instead a conversions object gives binary, octal, decimal, hexadecimal, base32 and base36 together. Note that base32 here is plain radix-32 digits (0-9, A-V), not RFC 4648 Base32 encoding.

What people use it for

Programming
Convert between binary, octal, decimal, and hexadecimal for programming and debugging
Computer Science Education
Teach number systems and base conversion concepts in educational tools
Data Encoding
Convert between different number representations for data encoding and decoding
Network Analysis
Work with hexadecimal values in network protocols and packet analysis

Without writing code

The Base Converter widget from WidgetSpark converts binary, hex and decimal from your desktop.

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 Number Base Converter

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

Questions.

Common questions about the Number Base Converter API.

Read the docs →
What range of bases does the converter support?
It supports any integer base from 2 through 36. Standard formats like binary, octal, decimal, and hexadecimal are fully supported alongside arbitrary custom bases within that range.
What happens if I omit the target base parameter?
The API returns conversions for all common bases at once. It provides the decimal equivalent and common representations simultaneously, eliminating the need to make multiple conversion requests.
Does the input number always have to be decimal?
No. You can specify any source base from 2 through 36 using the source parameter. If omitted, the source base defaults to decimal (base 10), but you can pass binary, hexadecimal, or any supported base string directly.
Can I convert values using bases higher than 36?
No. Number Base Converter restricts base values to the range of 2 through 36, utilizing digits 0 through 9 and alphabet characters. Bases outside this range are not supported.
What would 20,000 base conversions a month cost me?
At 1 credit per call, 20,000 conversions consume 20,000 credits, using a tenth of the Starter plan's 200,000 credits. Starter covers up to 200,000 conversions monthly, which works out to about $0.15 per 1,000 calls. The Free plan provides 200 calls per month.

Ready to build with Number Base Converter? 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