# Number Base Converter API
> Convert integers between any numeral systems with exact big-integer math. Pass a number and a from/to base (radix 2 to 36, arbitrarily large, signed) and the convert endpoint returns the result and the decimal value; common 0x, 0b and 0o prefixes are accepted when they match the base, and whitespace or underscores in the input are ignored. The bases endpoint shows a single number across binary, octal, decimal, hexadecimal, base32 and base36 at once, together with its bit length, byte length and sign. Everything is computed locally with BigInt, so values of any size are exact and deterministic. Ideal for low-level and embedded debugging, networking and bit-twiddling work, teaching number systems, and anywhere you juggle hex, binary and decimal. A numeral-base converter — distinct from the text-encoding toolkit (encoding: base64/base32/hex of bytes), the Elixir/Erlang Hex package registry (hex) and number-to-words (numberwords). No upstream key, no cache.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/baseconvert-api/..."
```

## Pricing
- **Free** (Free) — 2,100 calls/Mo, 2 req/s
- **Starter** ($6/Mo) — 40,500 calls/Mo, 8 req/s
- **Pro** ($20/Mo) — 214,000 calls/Mo, 20 req/s
- **Mega** ($53/Mo) — 815,000 calls/Mo, 50 req/s

## Endpoints

### Base Converter

#### `GET /v1/bases` — A number across common bases

**Parameters:**
- `number` (query, required, string) — The number Example: `255`
- `from` (query, optional, string) — Source base 2-36 (default 10)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/baseconvert-api/v1/bases?number=255"
```

**Response:**
```json
{
    "data": {
        "input": "255",
        "octal": "377",
        "base32": "7v",
        "base36": "73",
        "binary": "11111111",
        "decimal": "255",
        "negative": false,
        "from_base": 10,
        "bit_length": 8,
        "byte_length": 1,
        "hexadecimal": "ff"
    },
    "meta": {
        "timestamp": "2026-06-01T23:40:42.125Z",
        "request_id": "5624005a-44b4-4f6d-989e-998fc0a4b84b"
    },
    "status": "ok",
    "message": "Bases computed",
    "success": true
}
```

#### `GET /v1/convert` — Convert between bases

**Parameters:**
- `number` (query, required, string) — The number (in the from base) Example: `ff`
- `from` (query, optional, string) — Source base 2-36 (default 10) Example: `16`
- `to` (query, optional, string) — Target base 2-36 (default 10) Example: `2`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/baseconvert-api/v1/convert?number=ff&from=16&to=2"
```

**Response:**
```json
{
    "data": {
        "input": "ff",
        "result": "11111111",
        "decimal": "255",
        "to_base": 2,
        "from_base": 16
    },
    "meta": {
        "timestamp": "2026-06-01T23:40:42.222Z",
        "request_id": "03f81cf4-6266-4e82-a831-cb4fec0db87f"
    },
    "status": "ok",
    "message": "Number converted",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Radix range & digits

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/baseconvert-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "Convert integers between numeral systems with exact big-integer math. /v1/convert?number=ff&from=16&to=2 converts a number from one base to another (radix 2–36, arbitrarily large, with sign and the decimal value); common prefixes 0x, 0b and 0o are accepted when they match the base, and whitespace/underscores in the input are ignored. /v1/bases?number=255 shows a number across binary, octal, decimal, hexadecimal, base32 and base36 at once, plus its bit length, byte length and sign. Everything is computed locally with BigInt, so values of any size are exact. Ideal for low-level debugging, embedded and networking work, teaching, and anywhere you juggle hex/binary/decimal. A numeral-base converter — distinct from the text-encoding toolkit (encoding: base64/base32/hex of bytes), the Elixir Hex package registry (hex) and number-to-words (numberwords). No key, no cache.",
        "digits": "0123456789abcdefghijklmnopqrstuvwxyz",
        "endpoints": [
            "/v1/convert",
            "/v1/bases",
            "/v1/meta"
        ],
        "radix_range": [
            2,
            36
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T23:40:42.321Z",
        "request_id": "b9544d29-8a5e-42d1-8ffb-416d47f6676c"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/baseconvert-api
OpenAPI spec: https://www.oanor.com/api/baseconvert-api/openapi.json
