# Integer base convert

`integer-base-convert` · version 1.0.0 · Numbers & math · free, no key needed

Convert a signed integer string between bases 2 and 36 using BigInt.

**Use when you need to: integer base convert · convert integer base · base convert integer.**

## Supported

- integer base convert
- convert integer base
- base convert integer

## Not supported

- floats
- base 1
- base 64
- leading zeros output

## Behavior

- from_base and to_base are JSON integers in 2..36.
- value is an optional ASCII minus then digits of from_base. Digits 0-9 then a-z or A-Z. Empty, plus, and spaces are rejected.
- Leading zeros are rejected except for zero itself. -0 is rejected. Digit characters must be in range for from_base.
- Output is canonical in to_base: no plus, no leading zeros, lowercase digits, minus only if negative, and 0 is "0".
- At most 256 significant digits in the source excluding the sign. Computation uses BigInt. JSON BigInt is never returned.

## Input

- `value` (string, required): min length 1; max length 257
- `from_base` (integer, required): min 2; max 36
- `to_base` (integer, required): min 2; max 36

## Output

- `canonical` (string, required)

## Limits

- max integer digits: 256
- min base: 2
- max base: 36

## Example

Request input:

```json
{
  "value": "FF",
  "from_base": 16,
  "to_base": 10
}
```

Response:

```json
{
  "result": {
    "canonical": "255"
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "integer-base-convert",
  "version": "1.0.0",
  "input": {
    "value": "FF",
    "from_base": 16,
    "to_base": 10
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/integer-base-convert/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"value":"FF","from_base":16,"to_base":10}'
```

The machine-readable contract is at [/v1/tools/integer-base-convert/versions/1.0.0](/v1/tools/integer-base-convert/versions/1.0.0).

### CLI

```sh
node cli.mjs run integer-base-convert 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Integer digit sum](/tools/integer-digit-sum): Sum the base-b digits of the magnitude of an integer string.
- [Integer digital root](/tools/integer-digital-root): Repeatedly sum the base-b digits of the magnitude of an integer string until a single digit remains.
- [Angle DMS convert](/tools/angle-dms-convert): Convert a signed integer angle between degrees, arcminutes, and arcseconds as an exact rational.
- [Array integer adjacent diff](/tools/array-integer-adjacent-diff): Replace an array of canonical integer strings with consecutive first differences.
- [Array integer clamp](/tools/array-integer-clamp): Clamp an array of canonical integer strings to optional inclusive min and max bounds.
- [Array integer cumulative sum](/tools/array-integer-cumulative-sum): Replace an array of canonical integer strings with equal-length prefix sums.
