Hex Calculator
Convert between decimal, hexadecimal, and binary number systems. Perform hex arithmetic operations with ease.
Hex Calculator
Number Conversion
Hex Arithmetic
Conversion Results
Hexadecimal Conversion Table
| Decimal | Hexadecimal | Binary | Octal |
|---|---|---|---|
| 0 | 0 | 0000 | 0 |
| 1 | 1 | 0001 | 1 |
| 2 | 2 | 0010 | 2 |
| 3 | 3 | 0011 | 3 |
| 4 | 4 | 0100 | 4 |
| 5 | 5 | 0101 | 5 |
| 6 | 6 | 0110 | 6 |
| 7 | 7 | 0111 | 7 |
| 8 | 8 | 1000 | 10 |
| 9 | 9 | 1001 | 11 |
| 10 | A | 1010 | 12 |
| 11 | B | 1011 | 13 |
| 12 | C | 1100 | 14 |
| 13 | D | 1101 | 15 |
| 14 | E | 1110 | 16 |
| 15 | F | 1111 | 17 |
Frequently Asked Questions
Hexadecimal (often abbreviated as hex) is a base-16 number system that uses 16 distinct symbols: 0-9 to represent values zero to nine, and A-F (or a-f) to represent values ten to fifteen. Hexadecimal is commonly used in computing and digital systems because it provides a more human-friendly representation of binary-coded values. Each hexadecimal digit represents four binary digits (bits), which makes it a compact way to express binary data.
To convert from hexadecimal to decimal, multiply each digit by 16 raised to the power of its position (starting from 0 on the right) and sum the results. For example, to convert 2A from hex to decimal: (2 × 16¹) + (A × 16⁰) = (2 × 16) + (10 × 1) = 32 + 10 = 42 in decimal. To convert from decimal to hexadecimal, repeatedly divide the decimal number by 16 and keep track of the remainders, which correspond to hexadecimal digits.
Converting between hexadecimal and binary is straightforward because each hexadecimal digit corresponds to exactly four binary digits. To convert from hex to binary, replace each hex digit with its 4-bit binary equivalent. For example, 2A in hex becomes 00101010 in binary (2 becomes 0010 and A becomes 1010). To convert from binary to hex, group the binary digits into sets of four (starting from the right), then convert each group to its hexadecimal equivalent.
Bitwise operations are operations that manipulate individual bits within a binary number. In hexadecimal, these operations work on the underlying binary representation. The common bitwise operations are: AND (sets each bit to 1 if both bits are 1), OR (sets each bit to 1 if at least one of the bits is 1), XOR (sets each bit to 1 if the bits are different), and NOT (inverts all the bits). These operations are fundamental in low-level programming and digital logic design.
Hexadecimal numbers are widely used in computing and digital systems. Common applications include: representing memory addresses and data in programming, defining colors in HTML/CSS (RGB values), encoding MAC addresses and IPv6 addresses, displaying error codes, and representing binary data in a more compact form. Programmers often use hex when working with low-level system operations, debugging, and reverse engineering because it provides a more readable representation of binary data.