Hex Converter
This free hex converter takes a number in any base (hexadecimal, decimal, binary or octal) and shows all four bases at once, with automatic base detection and 64-bit support.
Decimal
255
Hexadecimal
0xFF
Binary
1111 1111
Octal
377
Examples
How to use
- 1
Type a value: 255, 0xFF, 1010 or 0o777. The base is detected from prefixes and digits.
- 2
Force the input base with the dropdown when a value is ambiguous, like 101.
- 3
Read the four panels: decimal, hexadecimal, binary (grouped by 4 bits) and octal, all updated live.
- 4
Copy any base with its own button, or download the full conversion as a file.
How do you convert hex to decimal?
Hexadecimal is base 16: the digits 0 to 9 plus the letters A to F, where A is 10 and F is 15. Programmers reach for it because one hex digit maps to exactly four bits, so a byte of 8 bits is always two hex digits. The binary 11111111 is a mouthful, yet in hex it is just FF.
To turn hex into decimal, multiply each digit by its power of 16. Take 0xFF: the first F is 15 x 16 = 240, the second F is 15 x 1 = 15, and 240 + 15 = 255. A longer one, 0x1A3, works out to 1 x 256 + 10 x 16 + 3 = 419.
How do you convert decimal to hex?
Go the other way by dividing the number by 16 over and over, keeping each remainder. For 255: 255 / 16 = 15 remainder 15, then 15 / 16 = 0 remainder 15. Read the remainders bottom to top, 15 then 15, which is FF. The tool runs the division for you and shows binary (11111111) and octal (377) at the same time, so you never convert twice.
What does one number look like in four bases?
| Decimal | Hex | Binary | Octal |
|---|---|---|---|
| 10 | A | 1010 | 12 |
| 64 | 40 | 1000000 | 100 |
| 255 | FF | 11111111 | 377 |
| 4096 | 1000 | 1000000000000 | 10000 |
| 65535 | FFFF | 1111111111111111 | 177777 |
How does base detection work?
Prefixes win first: 0x means hex, 0b means binary, 0o means octal, the notation most languages use. Without a prefix, any letter from A to F marks the value as hex. A run of only 0s and 1s longer than three digits reads as binary. Everything else reads as decimal.
Watch out for ambiguous values
A value like 101 is legal in all four bases: 101 in decimal, 257 from hex, 5 from binary, 65 from octal. Auto-detect treats short 0/1 strings as decimal, so reach for the dropdown to force binary when that is what you mean. The same goes for 10, which reads as decimal ten rather than binary two.
How large a number can it handle?
The converter runs on BigInt arithmetic, so it stays exact up to 18,446,744,073,709,551,615 (0xFFFFFFFFFFFFFFFF), the largest unsigned 64-bit value. Ordinary JavaScript numbers lose precision past 2^53, which is how many online converters quietly corrupt long hashes and memory addresses. This one refuses anything beyond 64 bits instead of rounding it.
Where do you meet each base?
Hex turns up in CSS colors (#FF6600), memory addresses, MAC addresses and hash digests. Binary shows up in permission masks and low-level debugging. Octal survives mainly in Unix file permissions, where chmod 755 is octal for rwxr-xr-x. Decimal is what everyone else uses. Moving between them is daily work for anyone reading logs or writing drivers.
ASCII Table
| Char | Decimal | Hex | Binary | Name |
|---|---|---|---|---|
| NUL | 0 | 00 | 00000000 | Null |
| SOH | 1 | 01 | 00000001 | Start of Heading |
| STX | 2 | 02 | 00000010 | Start of Text |
| ETX | 3 | 03 | 00000011 | End of Text |
| EOT | 4 | 04 | 00000100 | End of Transmission |
| ENQ | 5 | 05 | 00000101 | Enquiry |
| ACK | 6 | 06 | 00000110 | Acknowledge |
| BEL | 7 | 07 | 00000111 | Bell |
| BS | 8 | 08 | 00001000 | Backspace |
| HT | 9 | 09 | 00001001 | Horizontal Tab |
| LF | 10 | 0A | 00001010 | Line Feed |
| VT | 11 | 0B | 00001011 | Vertical Tab |
| FF | 12 | 0C | 00001100 | Form Feed |
| CR | 13 | 0D | 00001101 | Carriage Return |
| SO | 14 | 0E | 00001110 | Shift Out |
| SI | 15 | 0F | 00001111 | Shift In |
| DLE | 16 | 10 | 00010000 | Data Link Escape |
| DC1 | 17 | 11 | 00010001 | Device Control 1 (XON) |
| DC2 | 18 | 12 | 00010010 | Device Control 2 |
| DC3 | 19 | 13 | 00010011 | Device Control 3 (XOFF) |
| DC4 | 20 | 14 | 00010100 | Device Control 4 |
| NAK | 21 | 15 | 00010101 | Negative Acknowledge |
| SYN | 22 | 16 | 00010110 | Synchronous Idle |
| ETB | 23 | 17 | 00010111 | End of Transmission Block |
Parameters
Every field of this tool can be prefilled from the URL. Use these query parameters:
| Parameter | Type | Default |
|---|---|---|
| value | string | 255 |
| from | auto | dec | hex | bin | oct | auto |
Example : https://www.veltotools.com/conversion/hex-converter?value=255
API
The same tool is available as a free JSON API, with the same parameters as above. No key, no sign-up.
Frequently asked questions
Updated Jul 17, 2026