hex converter
hex_converterConvert numbers between hexadecimal, binary, decimal, and octal bases. Accepts any base as input (prefix 0x for hex, 0b for binary, 0o for octal, or plain decimal) and returns all four representations simultaneously. Also reports bit width, byte count, ASCII character (if printable), and signed interpretations (8-bit, 16-bit, 32-bit two's complement). Essential for embedded programming, register debugging, network protocol analysis, and color code conversion. Example: 0xFF → decimal 255, binary 0b11111111, octal 0o377, 8 bits, 1 byte.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| value | Yes | The number to convert. Prefix with 0x for hex (0xFF), 0b for binary (0b1010), 0o for octal (0o17). Plain numbers are treated as decimal. Supports negative values with leading minus. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hex | Yes | Hexadecimal string with 0x prefix (e.g. '0xFF'). | |
| bits | Yes | Minimum number of bits needed to represent this value (unsigned). | |
| ascii | Yes | ASCII character if the value is a printable character (32-126), null otherwise. | |
| bytes | Yes | Minimum number of bytes needed (ceil(bits/8)). | |
| octal | Yes | Octal string with 0o prefix (e.g. '0o377'). | |
| binary | Yes | Binary string with 0b prefix (e.g. '0b11111111'). | |
| decimal | Yes | Decimal (base-10) value. | |
| signed_8 | Yes | Signed 8-bit interpretation (-128 to 127), null if out of range. | |
| hex_upper | Yes | Hexadecimal with uppercase letters (e.g. '0xFF'). | |
| signed_16 | Yes | Signed 16-bit interpretation (-32768 to 32767), null if out of range. | |
| signed_32 | Yes | Signed 32-bit interpretation, null if out of range. |