Number Base Converter API
Convert a whole number of any size between binary, octal, decimal, hexadecimal and any base from 2 to 36.
POST /api/v1/tools/number-base-converterMCP number_base_converterDeveloper ToolsConvert whole numbers between binary, octal, decimal, hex and any base from 2 to 36. Exact for huge and negative numbers, with prefixes and digit grouping.
Input
Send these as a JSON object. Unknown fields are rejected.
- input
- The number. Spaces, underscores and (in decimal) commas are ignored; 0x, 0b and 0o prefixes are understood. (string, up to 10000 characters, required)
- from
- Base of the input, 2 to 36. With 10, a 0x/0b/0o prefix switches to that base. (integer, 2 to 36, default 10)
- to
- An extra target base (2 to 36) besides 2, 8, 10 and 16. (integer, 2 to 36)
- group
- Separate digit groups (4 for binary/hex, 3 for octal/decimal). (boolean, default false)
- uppercase
- Uppercase letter digits (A–Z). (boolean, default false)
curl https://pithlab.com/api/v1/tools/number-base-converter \n -H "Authorization: Bearer $PITHLAB_KEY" \n -H "Content-Type: application/json" \n -d '{"input":"255","from":10,"to":36}'Example response
{
"ok": true,
"result": {
"detectedBase": 10,
"conversions": [
{
"base": 2,
"label": "Binary (base 2)",
"value": "11111111"
},
{
"base": 8,
"label": "Octal (base 8)",
"value": "377"
},
{
"base": 10,
"label": "Decimal (base 10)",
"value": "255"
},
{
"base": 16,
"label": "Hexadecimal (base 16)",
"value": "ff"
},
{
"base": 36,
"label": "Base 36",
"value": "73"
}
]
}
}