Convert between hexadecimal, decimal, binary, and RGB color values with this free online tool.
Convert between decimal and hexadecimal numbers:
Convert between binary and hexadecimal numbers:
Convert between RGB color values and hexadecimal color codes:
Hexadecimal (or "hex") is a base-16 number system that uses 16 distinct symbols: the numbers 0-9 and the letters A-F (or a-f) to represent values 10-15. It's commonly used in computing to represent binary data in a more human-readable format.
To convert hexadecimal to decimal, multiply each digit by its corresponding power of 16 and sum the results.
Hex: 1 A 3
Position values: 16^2 16^1 16^0
Calculation: 1×256 + 10×16 + 3×1
Decimal: 256 + 160 + 3 = 419
To convert decimal to hexadecimal, divide the number by 16 repeatedly and record the remainders in reverse order.
Decimal: 419
419 ÷ 16 = 26 remainder 3
26 ÷ 16 = 1 remainder 10 (A)
1 ÷ 16 = 0 remainder 1
Hex (reading remainders from bottom to top): 1A3
Hexadecimal is widely used in computing for several reasons:
Hexadecimal is used because it provides a more compact and readable way to represent binary data. Since 16 is a power of 2 (2^4), each hexadecimal digit precisely represents 4 binary digits, making conversion between binary and hexadecimal straightforward.
Hexadecimal numbers are often prefixed with "0x" (in programming languages like C, Java, and JavaScript) or "#" (in web colors). For example, 0x1A3 or #1A3.
In web design, colors are often represented as 6-digit hexadecimal numbers, where the first two digits represent the red component, the middle two represent green, and the last two represent blue. Each pair ranges from 00 (no color) to FF (full color). For example, #FF0000 is pure red, #00FF00 is pure green, and #0000FF is pure blue.