Hex, Binary, Decimal & ASCII Converter
Convert between hex, binary, decimal, octal and ASCII, with width-aware bit grids and endianness swapping.
Example: 255 as a 8-bit value is 0xFF, 255 unsigned, -1 signed, 0b11111111.
Check it against real silicon
Chiprun runs your firmware on an emulated microcontroller and hands back the UART output, so you can confirm these numbers rather than trusting them.
Formula
value mod 2^width, interpreted signed and unsignedWorked example
255 as a 8-bit value is 0xFF, 255 unsigned, -1 signed, 0b11111111.
unsigned = value mod 2^width
unsigned = 255 mod 2^8
unsigned = 255
signed = unsigned − 2^width (when the top bit is set)
signed = 255 − 256
signed = -1
Frequently asked questions
What is 255 in binary?
11111111 — eight bits, all set. In hexadecimal that is 0xFF, which is why 255 is the largest value a single byte can hold as an unsigned number.
Why does the same value show as two different decimals?
Signedness. In two's complement the top bit indicates sign, so the byte 0xFF is 255 when read as unsigned and −1 when read as signed. The bits are identical; only the interpretation differs. Mismatched signedness across an interface is a very common bug.
What does byte-swapped mean?
It shows the value with its byte order reversed — big-endian read as little-endian, or vice versa. If a multi-byte register looks like garbage but its byte-swapped form looks sensible, you have an endianness mismatch rather than a data problem.
How do I convert hex to decimal by hand?
Multiply each digit by its place value, which is a power of 16. 0x1F is 1 × 16 + 15 = 31. Grouping hex into 4-bit nibbles is why it is used for register work: each hex digit maps to exactly four bits.
What happens if my number is too big for the width?
It gets truncated — the high bits are simply discarded, keeping the low ones. This tool shows the truncated result and warns you, because that is precisely what the hardware register will do with the value.
Related tools
Two's Complement Calculator
Signed and unsigned interpretation at any register width, with overflow and carry flags.
Firmware
Bitwise Operation Calculator
AND, OR, XOR, NOT and shifts with a live bit grid so you can see exactly which bits moved.
Firmware
IEEE 754 Float Converter
Convert between decimal, hex and binary float32/float64, with the sign, exponent and mantissa fields broken out.
Firmware
Base64 & Hex Blob Converter
Convert firmware blobs between base64, hex and raw bytes, with size and checksum readouts.
Firmware
CRC Calculator
CRC-8, CRC-16 (CCITT, Modbus, XMODEM) and CRC-32 over hex or ASCII input, with the polynomial and shift steps explained.
Firmware
PWM Frequency & Duty Calculator
The frequency-versus-resolution trade-off made explicit, with register values for your MCU and duty-cycle counts.
Firmware