Binary to Decimal Converter

Convert binary numbers (0s and 1s) to decimal with our step-by-step calculator. Learn the positional value method, see detailed examples, and understand how computers store numbers.

Calculation Steps

What is Hexadecimal?

Hexadecimal (often called "hex") is a base-16 number system that uses sixteen digits: 0-9 and A-F (where A=10, B=11, C=12, D=13, E=14, F=15). The name comes from Greek "hex" (six) and Latin "decem" (ten).

Hexadecimal is extremely useful in computing because it's a compact way to represent binary numbers. Each hexadecimal digit represents exactly four binary digits (bits), making conversions between binary and hex straightforward. Hex provides a human-friendly way to work with binary data.

Hexadecimal digits: 0 1 2 3 4 5 6 7 8 9 A B C D E F

You've probably seen hexadecimal in web color codes (like #FF0000 for red) or in programming when looking at memory addresses. Understanding hex is essential for anyone working with computers at more than a basic level.

How to Convert Decimal to Hexadecimal

Converting decimal to hexadecimal uses the division-by-16 method. The key difference from other bases is handling remainders 10-15, which become letters A-F:

  1. Start with your decimal number - Let's convert 300 to hexadecimal
  2. Divide by 16 - 300 ÷ 16 = 18 with remainder 12
  3. Convert remainder to hex - Remainder 12 becomes C in hexadecimal
  4. Write down the hex remainder - C becomes the rightmost digit
  5. Divide the quotient by 16 - Take 18 and divide by 16: 18 ÷ 16 = 1 remainder 2
  6. Write down this remainder - 2 becomes the next digit to the left
  7. Repeat until quotient is less than 16 - Keep dividing until quotient is less than 16
  8. The last quotient becomes the leftmost digit - When quotient is less than 16, convert it to hex if needed
  9. Read from bottom to top - The hex number is read from last quotient to first remainder

Complete example: Convert 300 to hexadecimal

300 ÷ 16 = 18 remainder 12 (C in hex)

18 ÷ 16 = 1 remainder 2

1 is less than 16, so we stop here

Hexadecimal result: Read from last quotient to first remainder: 12C

So 300 in decimal = 12C in hexadecimal

Our converter handles all these steps automatically, including converting numbers 10-15 to letters A-F.

Where You See Hexadecimal

Hexadecimal appears in many areas of technology:

Next time you see a color code or a strange code with letters and numbers, it's probably hexadecimal!

Hexadecimal Color Codes

One of the most common uses of hexadecimal is in web color codes. Colors on the web are specified using a # followed by six hexadecimal digits:

How web colors work

Format: #RRGGBB

RR = Red component (00 to FF, or 0 to 255 in decimal)

GG = Green component (00 to FF, or 0 to 255 in decimal)

BB = Blue component (00 to FF, or 0 to 255 in decimal)

Example: #FF0000 = Full red, no green, no blue = Red

ColorHexadecimalDecimal (R,G,B)
Red#FF0000255, 0, 0
Green#00FF000, 255, 0
Blue#0000FF0, 0, 255
Yellow#FFFF00255, 255, 0
Magenta#FF00FF255, 0, 255
Cyan#00FFFF0, 255, 255
White#FFFFFF255, 255, 255
Black#0000000, 0, 0

Try converting these decimal RGB values to hexadecimal using our converter!

Common Decimal to Hexadecimal Conversions

Here are important decimal numbers and their hex equivalents:

DecimalHexadecimalWhat It Represents
00Zero in all bases
10AFirst letter in hex
15FLargest single hex digit
1610First "carry" in hex
255FFMaximum 8-bit value, white in web colors
256100One more than max 8-bit value
4096100016 cubed (16³)
65535FFFFMaximum 16-bit value
16777215FFFFFFMaximum 24-bit value, white in 24-bit color

Hexadecimal in Programming

Programmers use hexadecimal extensively because:

Hexadecimal in C/C++/Java

In these languages, hex numbers start with 0x:

0xFF = 255 in decimal

0x10 = 16 in decimal

0x1A = 26 in decimal (1×16 + 10)

0xDEADBEEF = 3,735,928,559 in decimal (a famous debug value)