# Number Base Converter API

> 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.

**Endpoint:** `GET https://api.apiverve.com/v1/numberbaseconverter`  
**Category:** Data Conversion  
**Cost:** 1 credit per call  
**Canonical page:** https://apiverve.com/marketplace/numberbaseconverter

## Overview

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.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl "https://api.apiverve.com/v1/numberbaseconverter?value=FF&from=16&to=10" \
  -H "x-api-key: YOUR_API_KEY"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `value` | string | Yes | The number to convert. Prefixes matching the base (0x or # for hex, 0b for binary, 0o for octal) and space or underscore digit grouping are accepted |
| `from` | integer | No | Source base (default: 10, or the base a 0x, #, 0b or 0o prefix names). default 10. range 2-36 |
| `to` | integer | No | Target base (returns all common bases if not specified). range 2-36 |

## Response fields

- `input_value` — string · Original input value
- `input_base` — number · Source base used for conversion
- `input_base_name` — string · Name of the input base, such as binary or hexadecimal
- `decimal_value` — number · Value in decimal (base 10)
- `decimal_value_exact` — string · The decimal value as an exact string. decimal_value is a number and cannot hold more than 15-16 significant digits; this field is exact for any input.
- `output_value` — string · Converted value in target base
- `output_base` — number · Base the value was converted to
- `output_base_name` — string · Name of the output base

## Sample response

```json
{
  "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"
  }
}
```

## Use cases

- **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

## SDKs

- **npm** — `npm install @apiverve/numberbaseconverter` (https://www.npmjs.com/package/@apiverve/numberbaseconverter)
- **NuGet** — `dotnet add package APIVerve.API.NumberBaseConverter` (https://www.nuget.org/packages/APIVerve.API.NumberBaseConverter)
- **Source** — https://github.com/apiverve/numberbaseconverter-api

## More

- Full reference: https://docs.apiverve.com/ref/numberbaseconverter
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
