About this endpoint
What it does
Converts an integer string from one base to another, using the request body fields to define the input value and the source and target bases. The endpoint accepts an input value that may include 0x/0o/0b prefixes and returns a structured JSON response.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| value | String | Yes | The number to convert; may include a 0x/0o/0b prefix. |
| to_base | Integer | No | Target base for the result, from 2 to 36. Default: 16. |
| from_base | Integer | No | Base of the input, from 2 to 36, or 0 to auto-detect. Default: 0. |
Response
Returns a JSON object with the value rendered in the requested base, the same value in the common bases (binary, octal, decimal, hexadecimal), and its storage size.
| Field | Type | Description |
|---|---|---|
| input | String | The original input value as submitted. |
| decimal | Integer | Decimal (base-10) representation. |
| binary | String | Binary (base-2) representation. |
| octal | String | Octal (base-8) representation. |
| hex | String | Hexadecimal (base-16) representation. |
| to_base | Integer | The target base used for result. |
| result | String | The converted value in the requested to_base. |
| bit_length | Integer | Number of bits required to represent the value. |
| byte_size | Integer | Minimum number of bytes required to store the value. |
| is_negative | Boolean | Whether the input value is negative. |



