Hexadecimal to Decimal Converter
Convert between hexadecimal (base-16) and decimal (base-10) with step-by-step place value calculations and multi-base output.
Hexadecimal to Decimal Converter
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser โ no data is sent to any server.
Formula: Decimal = Sum of (hex_digit x 16^position) | Hex = Repeated division by 16
Worked example โ RGB(60, 179, 113)
Formula
Decimal = Sum of (hex_digit x 16^position) | Hex = Repeated division by 16
Hexadecimal uses base 16 with digits 0-9 and A-F (representing 10-15). To convert hex to decimal, each digit is multiplied by 16 raised to its positional power and the results are summed. To convert decimal to hex, repeatedly divide by 16 and map remainders to hex digits.
Worked Examples
Example 1: CSS Color Code Conversion
Problem:Convert hex color #3CB371 (medium sea green) to its decimal RGB values.
Solution:Red: 3C hex = 3 x 16 + 12 = 60 Green: B3 hex = 11 x 16 + 3 = 179 Blue: 71 hex = 7 x 16 + 1 = 113
Result:RGB(60, 179, 113)
Example 2: Memory Address Conversion
Problem:Convert the hexadecimal memory address 0x7FFF to decimal.
Solution:7 x 16^3 = 7 x 4096 = 28672 F x 16^2 = 15 x 256 = 3840 F x 16^1 = 15 x 16 = 240 F x 16^0 = 15 x 1 = 15 Total = 28672 + 3840 + 240 + 15
Result:0x7FFF = 32,767 in decimal
Frequently Asked Questions
How do you convert hexadecimal to decimal?
To convert hexadecimal to decimal, multiply each hex digit by 16 raised to the power of its position (counting from right starting at 0), then sum all the values. Remember that hex digits A through F represent decimal values 10 through 15. For example, hex 1A3 equals 1 times 256 plus 10 times 16 plus 3 times 1, which is 256 plus 160 plus 3 equals 419 in decimal.
Why is hexadecimal used in computing?
Hexadecimal is widely used in computing because it provides a compact, human-readable representation of binary data. Each hex digit maps exactly to four binary digits (bits), making conversions straightforward. This is especially useful for representing memory addresses, color codes in web design (like #FF5733), MAC addresses, and byte values. A single byte (8 bits) can be represented by exactly two hex digits, ranging from 00 to FF.
What do the letters A through F mean in hexadecimal?
In hexadecimal notation, letters A through F represent the values 10 through 15 respectively. Since hexadecimal is base-16, it needs 16 unique symbols. The digits 0 through 9 cover the first ten values, and the letters A (10), B (11), C (12), D (13), E (14), and F (15) complete the set. Both uppercase and lowercase letters are valid and interchangeable in hex notation.
What is the repeated-division method for writing a base-10 number in base 16?
To convert decimal to hexadecimal, repeatedly divide the decimal number by 16, recording each remainder. Convert any remainder of 10 or higher to its letter equivalent (10=A, 11=B, 12=C, 13=D, 14=E, 15=F). Continue dividing the quotient by 16 until it reaches zero, then read the hex digits from the last remainder to the first. For example, 255 divided by 16 is 15 remainder 15, then 15 divided by 16 is 0 remainder 15, giving FF in hex.
How does hexadecimal relate to binary and octal?
Hexadecimal is base 16 and binary is base 2, and because 16 is 2 to the fourth power, every hex digit maps onto exactly four binary digits, a group called a nibble. Hex F is binary 1111, hex A is 1010 and hex 3 is 0011, so 0x3AF is 0011 1010 1111 with no arithmetic required. Octal is base 8 and maps onto groups of three bits instead, which suited nine and twelve bit machines and still fits Unix permission bits, but it aligns badly with modern eight-bit bytes.
What do the prefixes 0x and # mean in front of a hex number?
They are notation markers that tell a reader or a parser which base applies, because a string like 100 is valid in several bases. The 0x prefix comes from C and is used across C++, Java, Python, JavaScript and most assemblers. The hash symbol marks hex colour values in CSS and HTML. Other conventions include a trailing H in Intel assembly, a leading dollar sign in 6502 and Motorola assemblers, and 16# in Ada and Erlang. None of the markers is part of the value itself.
How many bytes does a string of hex digits represent?
Two hex digits encode exactly one byte, because a byte is eight bits and each hex digit covers four. So FF is one byte with the decimal value 255, FFFF is a two-byte word reaching 65,535, and eight hex digits describe a 32-bit value. This is why MAC addresses are twelve hex digits for six bytes, IPv6 groups are four digits for two bytes, and memory dumps are laid out in rows of sixteen byte pairs. An odd digit count means a leading zero was dropped.
How are negative numbers written in hexadecimal?
Computers normally store signed integers in two complement form rather than with a sign digit, so the hex representation depends on the word width. In eight bits, -1 is FF, -2 is FE and -128 is 80, because the stored value is 256 minus the magnitude. In sixteen bits, -1 becomes FFFF. Anything with the top bit set, meaning a leading hex digit from 8 through F, is negative when read as signed. The same bit pattern read as unsigned gives a large positive number, a frequent source of debugging confusion.
Why do hex colour codes have six digits?
A colour code such as #FF5733 packs three channel values into one string, two hex digits each for red, green and blue. Each pair spans 0 to 255, so FF is 255 units of red, 57 is 5 x 16 + 7 = 87 units of green, and 33 is 3 x 16 + 3 = 51 units of blue. Six digits therefore cover 256 cubed, or 16,777,216 colours. Eight-digit forms add a fourth pair for alpha transparency, and three-digit shorthand such as #F53 expands each digit into a pair.
What is the largest value a given number of hex digits can hold?
An n-digit hexadecimal number reaches 16 to the power n, minus one. Two digits top out at FF = 255, four digits at FFFF = 65,535, six digits at 16,777,215, and eight digits at FFFFFFFF = 4,294,967,295. Each extra digit multiplies the range by sixteen, matching four more bits of storage. Knowing these ceilings makes overflow obvious at a glance, since a counter displayed as FFFF that resets to 0000 has simply wrapped a 16-bit register.
References
Reviewed for accuracy by Manoj Kumar, Mathematics Educator ยท Editorial policy
Related Calculators
๐งฎBinaryto Hexadecimal Converter
Calculate binaryto hexadecimal converter with inputs, formulas, and instant results.
๐งฎDecimalto Hexadecimal Converter
Calculate decimalto hexadecimal converter with inputs, formulas, and instant results.
๐งฎOctal to Decimal Converter
Calculate octal to decimal converter with inputs, formulas, and instant results.
๐งฎBytes Converter
Convert between bytes, KB, MB, GB, TB, and PB in both binary and decimal systems.
๐งฎTorque Unit Converter
Calculate torque unit converter with inputs, formulas, and instant results.
๐งฎElectrical Resistance Converter (ฮฉ, kฮฉ, Mฮฉ)
Calculate electrical resistance unit converter with inputs, formulas, and instant results.
๐งฎTime Unit Converter
Calculate time unit converter with inputs, formulas, and instant results.
๐งฎArea Converter
Calculate area converter with inputs, formulas, and instant results.