Hex Converter
Prefixes 0x, 0b and 0o, spaces, underscores and a leading minus are accepted.
How to use
- In Numbers mode, type a value into any of the four boxes. The other three update right away.
- You can paste values with a 0x, 0b or 0o prefix, with spaces or underscores, or with a leading minus sign.
- In Text mode, type words on top to see their UTF-8 bytes in hex, or paste hex bytes below to read the text.
How it works
Each digit in base b is worth b raised to its position. 0xFF is 15 × 16 + 15 = 255, and 0b1010 is 8 + 2 = 10.
The converter uses BigInt, so there is no 53-bit limit. A 40-digit hex value converts exactly instead of being rounded.
Text mode encodes characters as UTF-8. Letters in the basic Latin range take one byte, so "A" is 41. Accented letters take two bytes, most other scripts take three, and emoji take four, so "€" is E2 82 AC.
FAQ
How do I convert hex to decimal?
Type the hex value into the Hexadecimal box. The Decimal box shows the result straight away. For example, FF becomes 255 and 1A3F becomes 6719.
Does it handle negative numbers?
Yes, with a minus sign: -FF is -255. It shows signed values, not two's complement. For a fixed width such as 8 or 32 bits you would need to work out the complement yourself.
Why does my hex string show an error in text mode?
Text mode needs an even number of hex digits and bytes that form valid UTF-8. A lone byte such as FF is not valid text, so it is rejected instead of showing a garbled character.
Is there a size limit?
No fixed limit. Values with thousands of digits work, although very long numbers take a moment to convert on slow devices.