Hex Converter
Convert hexadecimal values to decimal, binary and octal or choose another input base and convert that value to hexadecimal. Results use exact integer arithmetic and can be copied instantly.
10101052422AHexadecimal basics
- Hex is base 16: digits 0–9 then A–F (A = 10 … F = 15).
- Hex to decimal: multiply each digit by a power of 16 and add. 2A = 2 × 16 + 10 = 42.
- One hex digit = 4 bits, two hex digits = 1 byte (00–FF = 0–255).
- Colour codes like #FFA500 are three bytes: red, green and blue.
How to use the Hex Converter
- Choose the number base of the value you are entering.
- Enter a hexadecimal, decimal, binary or octal integer.
- Hexadecimal accepts 0 through 9 and letters A through F.
- A common 0x hexadecimal prefix or 0b binary prefix may be included.
- The tool converts the integer using BigInt arithmetic.
- The equivalent value is displayed in binary, octal, decimal and hexadecimal.
- Copy any result directly with its Copy button.
Reading hexadecimal
Hexadecimal is base 16. Each place is worth 16 times the place to its right, and the digits run 0 to 9 then A to F for 10 to 15. So 1F4 means 1 × 256 + 15 × 16 + 4 = 500.
Each hex digit stands for exactly four binary digits (bits), which is why programmers like it: 0xFF is the binary 1111 1111, one byte. To convert hex to binary, replace each digit with its 4-bit group from the table below; to go back, split the binary into groups of four from the right. The converter works with whole, non-negative numbers of any length and shows the result in all four bases at once.
Examples
Hex 2A to decimal
Hexadecimal 2A equals decimal 42 because 2 × 16 + 10 = 42.
Hex FF to decimal
Hexadecimal FF equals decimal 255 and binary 11111111.
Decimal 4096 to hex
Decimal 4096 equals hexadecimal 1000.
Binary 101010 to hex
Binary 101010 equals hexadecimal 2A.
Hex 1F4 to decimal
1F4 = 1 × 16² + 15 × 16 + 4 = 256 + 240 + 4 = 500.
Hex to binary digit by digit
0x3C becomes 0011 1100, because 3 = 0011 and C = 1100. In decimal that is 60.
Web colours in hex and RGB
| Colour | Hex | RGB (decimal) |
|---|---|---|
| Red | #FF0000 | 255, 0, 0 |
| Green | #00FF00 | 0, 255, 0 |
| Blue | #0000FF | 0, 0, 255 |
| White | #FFFFFF | 255, 255, 255 |
| Black | #000000 | 0, 0, 0 |
| Gray | #808080 | 128, 128, 128 |
| Orange | #FFA500 | 255, 165, 0 |
| Teal | #008080 | 0, 128, 128 |
Hex digits in decimal and binary
| Hex | Decimal | Binary |
|---|---|---|
| 0 | 0 | 0000 |
| 1 | 1 | 0001 |
| 2 | 2 | 0010 |
| 3 | 3 | 0011 |
| 4 | 4 | 0100 |
| 5 | 5 | 0101 |
| 6 | 6 | 0110 |
| 7 | 7 | 0111 |
| 8 | 8 | 1000 |
| 9 | 9 | 1001 |
| A | 10 | 1010 |
| B | 11 | 1011 |
| C | 12 | 1100 |
| D | 13 | 1101 |
| E | 14 | 1110 |
| F | 15 | 1111 |
Frequently asked questions
What is hexadecimal?
Hexadecimal is a base-16 number system using digits 0 through 9 and letters A through F, where A represents 10 and F represents 15.
How do I convert hex to decimal?
Multiply each hexadecimal digit by its corresponding power of 16 and add the values.
Why is hexadecimal used in programming?
Hexadecimal represents binary values compactly. One hexadecimal digit corresponds to four binary bits, which makes byte and memory values easier to read.
Can I enter lowercase hexadecimal letters?
Yes. Lowercase and uppercase hexadecimal letters are accepted.
Does 0x mean hexadecimal?
With hexadecimal selected, an optional 0x prefix is accepted. A hexadecimal input of 0B is eleven; it is not removed as a binary prefix. Choose the matching base before pasting a prefixed value.
What is FF in decimal?
255 (15 × 16 + 15).
Can I convert negative numbers or fractions?
No. The converter accepts whole numbers of zero or more. Negative values in computing are usually stored with two's complement, which depends on the number of bits used.
Is there a limit to how large the number can be?
The converter uses exact whole-number arithmetic, so long values such as 64-bit or 128-bit numbers convert without rounding.
More converters tools
Binary Converter
Convert binary, decimal, hexadecimal and octal integers instantly.
Open tool →Base64 Encoder & Decoder
Encode and decode UTF-8 Base64 and Base64URL text.
Open tool →URL Encoder & Decoder
Encode and decode URL-safe query-string text.
Open tool →Random Number Generator
Generate a random number within a custom range.
Open tool →Percentage Calculator
Calculate percentages, increases and decreases.
Open tool →Unit Converter
Convert length, weight, temperature, area, volume, speed and common metric and imperial units.
Open tool →