Hex to Decimal Converter
Number System Conversions
Computers use different number systems for different purposes. Decimal (base-10) is what humans use daily. Binary (base-2) is the fundamental language of computers, using only 0s and 1s. Hexadecimal (base-16) is used in programming for colors, memory addresses, and data representation. Octal (base-8) is used in some Unix file permissions. Continue your calculation with the Subnet Calculator, or check the Scientific Calculator.
Hexadecimal Explained
Hex uses 16 digits: 0-9 and A-F (where A=10, B=11, C=12, D=13, E=14, F=15). One hex digit represents exactly 4 binary digits, making it a compact way to represent binary data. For example, FF in hex equals 11111111 in binary equals 255 in decimal. Colors in web design use hex: #FF0000 is red, #00FF00 is green, #0000FF is blue.
What should you check before converting units?
Conversions are simple, but accuracy depends on using the correct unit. Always check whether the value is metric, imperial, digital, or temperature-based before comparing results. For work, study, travel, recipes, or shopping, round only at the end so the final number stays more accurate. If a result will be used for safety, construction, medicine, or finance, confirm it with an official standard or professional source.
What are the everyday uses for this tool?
This converter is useful for travel, recipes, study, product comparison, engineering notes, online shopping, and daily measurements. It is especially helpful when two sources use different systems, such as metric and imperial units.
What do the results actually tell you?
The Hex to Decimal Converter is built for people who want a fast answer without losing context. It keeps the calculation simple, shows the result clearly, and helps you understand what the number means before you use it in a real decision.
Conversion tools help translate values between measurement systems quickly. They are especially useful when comparing products, recipes, travel details, technical values, or international information.
What is hexadecimal?
Hexadecimal (hex) is a base-16 number system used extensively in computing, digital electronics, and programming. While the familiar decimal system uses 10 digits (0–9), hexadecimal uses 16 symbols: the digits 0–9 plus the letters A–F, where A = 10, B = 11, C = 12, D = 13, E = 14, and F = 15.
Hexadecimal is favoured in computing because it maps cleanly to binary (base-2) — each hex digit exactly represents 4 binary bits (a "nibble"). This makes hex a compact, human-readable way to express binary data. A single byte (8 bits) can be represented by exactly two hex digits (00 to FF), which is why hex appears everywhere in programming: memory addresses, colour codes, cryptographic hashes, MAC addresses, and machine code.
Converting between number systems
Decimal to Hexadecimal: Repeatedly divide by 16, record remainders in reverse order.
Convert 255 to hex: 255 ÷ 16 = 15 remainder 15 (F). 15 ÷ 16 = 0 remainder 15 (F). Reading remainders bottom-up: FF. So 255 (decimal) = FF (hex) = 11111111 (binary)
Hexadecimal to Decimal: Multiply each digit by 16 raised to its position power (rightmost = position 0).
Convert 2F to decimal: (2 × 16¹) + (15 × 16⁰) = 32 + 15 = 47
Convert 1A3 to decimal: (1 × 256) + (10 × 16) + (3 × 1) = 256 + 160 + 3 = 419
Hex to binary and binary to hex
Each hex digit maps to exactly 4 binary digits (bits):
- 0 = 0000 | 1 = 0001 | 2 = 0010 | 3 = 0011
- 4 = 0100 | 5 = 0101 | 6 = 0110 | 7 = 0111
- 8 = 1000 | 9 = 1001 | A = 1010 | B = 1011
- C = 1100 | D = 1101 | E = 1110 | F = 1111
Convert hex 3E to binary: 3 = 0011, E = 1110. Result: 00111110
Convert binary 10110101 to hex: Split into 4-bit groups: 1011 | 0101. 1011 = B, 0101 = 5. Result: B5
Common uses of hexadecimal in computing
- Colour codes (HTML/CSS): #FF5733 — each pair of hex digits (FF, 57, 33) represents Red, Green, Blue values from 0–255. #FFFFFF = white (255,255,255), #000000 = black (0,0,0), #FF0000 = pure red.
- Memory addresses: Memory locations are expressed in hex (e.g., 0x7FFEE4B8). The "0x" prefix indicates hexadecimal in most programming languages.
- MAC addresses: Network interface identifiers use hex pairs separated by colons: 00:1A:2B:3C:4D:5E — 6 bytes = 12 hex characters.
- File signatures (magic numbers): Files begin with hex sequences identifying their type. JPEG files start with FF D8 FF. PDF files start with 25 50 44 46 (%PDF in ASCII).
- Unicode code points: Characters are identified by hex code points. The ₹ (US Dollar) symbol = U+20B9 = decimal 8,377.
Hexadecimal in programming
Most programming languages support hex literals directly:
- Python:
0xFF= 255,hex(255)returns '0xff' - JavaScript:
0xFF= 255,(255).toString(16)returns 'ff' - C/C++:
0xFF= 255 - CSS:
#FF5733for RGB colour values
How hexadecimal is used in web design
Web colours use 6 hex digits: #RRGGBB where RR=red, GG=green, BB=blue intensity (each 00–FF). #FF0000 = pure red (255,0,0). #000000 = black (0,0,0). #FFFFFF = white (255,255,255). #808080 = 50% grey (128,128,128). CSS also accepts 3-digit shorthand: #F00 = #FF0000. Hex colours are the universal language of web design — every colour in CSS, Photoshop, Figma, and Canva can be specified by its 6-character hex code.
Why computers use hexadecimal instead of decimal
Each hex digit represents exactly 4 binary bits (a "nibble"). FF hex = 1111 1111 binary = 255 decimal. Two hex digits represent exactly one byte (8 bits). This makes hex a compact, human-readable shorthand for binary data: a 32-bit memory address is 8 hex digits (e.g. 0x1A2B3C4D) vs 10 decimal digits (440926285). Hexadecimal is standard in computer science for memory addresses, colour values, error codes, IP addresses, and cryptographic hashes.
Frequently asked questions about hexadecimal
Why do programmers use hexadecimal instead of decimal? Hex maps directly to binary — each hex digit represents exactly 4 bits, making it easy to read and write binary data in a compact form. A 32-bit value requires 10 decimal digits but only 8 hex digits. This compactness is crucial for reading memory dumps, machine code, and network packets.
What does "0x" mean before a number? The "0x" prefix is a convention in many programming languages to indicate that the following number is in hexadecimal. 0xFF means "hex value FF" = decimal 255. Similarly, "0b" indicates binary (0b11111111 = 255) and "0o" indicates octal in Python.
How is hex used in HTML colour codes? HTML/CSS colour codes like #3498DB use three hex pairs: 34 (Red = 52), 98 (Green = 152), DB (Blue = 219). Each pair ranges from 00 (0) to FF (255). Shorthand #RGB uses one hex digit per channel: #F00 = #FF0000 = red.
Hexadecimal, decimal, and binary reference table (0–255)
| Hex | Dec | Binary | Hex | Dec | Binary | Hex | Dec | Binary |
|---|---|---|---|---|---|---|---|---|
| 00 | 0 | 00000000 | 55 | 85 | 01010101 | AA | 170 | 10101010 |
| 01 | 1 | 00000001 | 64 | 100 | 01100100 | C0 | 192 | 11000000 |
| 0A | 10 | 00001010 | 7F | 127 | 01111111 | D0 | 208 | 11010000 |
| 0F | 15 | 00001111 | 80 | 128 | 10000000 | E0 | 224 | 11100000 |
| 10 | 16 | 00010000 | 8F | 143 | 10001111 | F0 | 240 | 11110000 |
| 1F | 31 | 00011111 | 90 | 144 | 10010000 | FA | 250 | 11111010 |
| 20 | 32 | 00100000 | 9F | 159 | 10011111 | FE | 254 | 11111110 |
| 3F | 63 | 00111111 | A0 | 160 | 10100000 | FF | 255 | 11111111 |
Common hex values in web and computing
| Hex Value | Decimal | Common Use |
|---|---|---|
| 0x00 | 0 | Null character, black (#000000) |
| 0x0A | 10 | Newline character (LF) |
| 0x20 | 32 | Space character (ASCII) |
| 0x41 | 65 | Letter "A" in ASCII |
| 0x61 | 97 | Letter "a" in ASCII |
| 0x7F | 127 | Delete character (DEL) |
| 0xFF | 255 | Max byte value; white (#FFFFFF) |
| 0xFFFF | 65535 | Max 16-bit unsigned integer |
| 0xFFFFFFFF | 4,294,967,295 | Max 32-bit unsigned integer; IPv4 broadcast |
Sources & References
Sources: IEEE 754-2019 Standard for Floating-Point Arithmetic; W3C CSS Color Module Level 4 (hex colour notation); Unicode Consortium — character encoding standards.
Hex colours in CSS: web development reference
CSS colours use 6-digit hex codes representing RGB values. Each pair of hex digits gives one colour channel (0–255). #RRGGBB format: #FF0000 = Red (255,0,0). #00FF00 = Green (0,255,0). #0000FF = Blue (0,255,0). #FFFFFF = White (255,255,255). #000000 = Black (0,0,0). To convert: #7C6DF0 → R=7C=124, G=6D=109, B=F0=240 → rgb(124,109,240). CSS also accepts shorthand 3-digit hex: #ABC = #AABBCC. Hex with opacity (CSS4): #RRGGBBAA — the last pair is the alpha channel. Example: #FF000080 = 50% transparent red.
Binary, decimal, octal, and hex conversion table
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 5 | 0101 | 5 | 5 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 32 | 100000 | 40 | 20 |
| 64 | 1000000 | 100 | 40 |
| 127 | 1111111 | 177 | 7F |
| 255 | 11111111 | 377 | FF |