Skip to main content

Online Calculators and Tools | Calculators Toolbox

Hex Converter

This hex converter changes decimal to hexadecimal and hex back to decimal, with binary and octal shown too.

Home / Hex Converter
Hex Converter illustration showing a color palette of glowing swatches connected to a computer screen showing code brackets and a circuit pattern
Hex Converter

Calculation Explanation

Free tool by Hex Converter – CalculatorsToolbox

Hex Converter – Hexadecimal to Decimal and Back

Our free hex converter changes decimal numbers into hexadecimal and hex values back into decimal, with every step explained. Each result also shows the binary and octal equivalents, making it handy for programming, web colors and networking.

What Is Hexadecimal?

Hexadecimal, or hex, is a base-16 number system. It uses sixteen symbols: the digits 0–9 for values zero to nine, and the letters A–F for ten to fifteen. So A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15. Each place in a hex number is worth 16 times the place to its right: ones, sixteens, 256s, 4,096s and so on.

Programmers love hex because it's a compact way to write binary. One hex digit represents exactly four bits, so a byte (8 bits) is always two hex digits, from 00 to FF. That's far easier to read than 11111111. You'll see hex in color codes like #FF5733, memory addresses, error codes, MAC addresses and encryption keys.

How to Convert Between Hex and Decimal

To go from decimal to hex, divide by 16 repeatedly and write the remainders as hex digits. To go from hex to decimal, multiply each digit by its power of 16 and add.

Hex → Decimal: Σ (digit value × 16position)  |  Decimal → Hex: divide by 16, read remainders bottom to top

For BEEF: B (11) × 4,096 + E (14) × 256 + E (14) × 16 + F (15) × 1 = 45,056 + 3,584 + 224 + 15 = 48,879. And 48,879 ÷ 16 gives remainders F, E, E, B, which read upward spell BEEF again.

Example Calculations:

255 to hex15 × 16 + 15 → FF
BEEF to decimal48,879
1A3 to decimal256 + 160 + 3 = 419
4,096 to hex16³ → 1000

How to Use the Hex Converter

  1. On the Decimal → Hexadecimal tab, type any whole number, up to 30 digits long.
  2. The hex value appears instantly, with binary and octal versions underneath.
  3. To decode a hex value, switch to Hexadecimal → Decimal. Upper or lower case both work, and a 0x prefix is ignored.
  4. The explanation box shows the repeated division or the powers-of-16 sum.

Where Hexadecimal Is Used

Web Colors

#1E90FF means red 1E (30), green 90 (144), blue FF (255), a bright "dodger blue".

Memory Addresses

Debuggers display addresses like 0x7FFE4A2C because hex is shorter and maps neatly onto binary.

MAC Addresses

Network cards have IDs such as 3C:22:FB:9A:01:7E, six bytes written as hex pairs.

IPv6 Addresses

IPv6 addresses like 2001:0db8::1 are written in hex groups of four digits.

Error Codes

Windows and other systems report errors as hex codes like 0x80070005 (access denied).

Unicode Characters

Characters are identified by hex code points: U+0041 is A, and U+1F600 is the grinning-face emoji.

Hexadecimal Concepts

Hex Digits A to F

Because base 16 needs sixteen symbols, the letters A–F stand for the values 10–15. Case doesn't matter: ff and FF are the same.

Hex and Binary

Every hex digit equals exactly four binary digits: 0 = 0000, 9 = 1001, A = 1010, F = 1111. To convert hex to binary, simply swap each digit for its four bits. See the full working with the binary converter.

Example: 3C = 0011 1100.

Prefixes and Notation

Hex numbers are often marked so they aren't confused with decimal: 0x in programming (0xFF), # in CSS colors (#FF0000), a subscript 16 in math (FF₁₆), or an h suffix in some assembly languages (FFh).

Color Codes

A six-digit color code is three bytes: #RRGGBB. Each pair ranges from 00 (none) to FF (full). #000000 is black, #FFFFFF is white and #FF0000 is pure red. Short codes like #F80 expand to #FF8800.

Tips for Working With Hex

  • Memorize A = 10 through F = 15; the rest follows from ordinary place value.
  • Two hex digits are one byte, so FF is the largest single-byte value (255).
  • Powers of 16 to know: 16, 256, 4,096 and 65,536.
  • To check a conversion, convert it back the other way.
  • Hex numbers ending in 0, 2, 4, 6, 8, A, C or E are even.
  • For base-8 values instead, use the octal converter.

Hex to Decimal Table

HexDecimalBinaryHexDecimalBinary
000000881000
110001991001
220010A101010
330011B111011
440100C121100
550101D131101
660110E141110
770111F151111

Step-by-Step Worked Example

Convert the decimal number 2,026 to hex.

  1. 2,026 ÷ 16 = 126 remainder 10 → A.
  2. 126 ÷ 16 = 7 remainder 14 → E.
  3. 7 ÷ 16 = 0 remainder 7 → 7.
  4. Read the remainders from bottom to top: 7EA.
  5. Check: 7 × 256 + 14 × 16 + 10 = 1,792 + 224 + 10 = 2,026. ✓

Type 2026 into the hex converter and you'll get 7EA, plus the binary form 0111 1110 1010.

Reading a CSS Color Code

Web designers convert hex constantly, even if they don't think of it that way. Take the color #2575FC used in the calculator button above. Split it into pairs: 25, 75 and FC. In decimal those are 37, 117 and 252, so the color is rgb(37, 117, 252), a bright blue with a little red and green. Lighter colors have higher values in every pair; darker ones have lower values. Understanding hex lets you tweak colors by hand instead of reaching for a color picker every time.

Hex Arithmetic and Shortcuts

Adding hex works like decimal but carries at 16 instead of 10: 9 + 7 = 16, which is written 10 in hex, and F + 1 = 10. Multiplying by 16 just adds a 0 on the right, so A becomes A0 (160). A handy shortcut for hex-to-binary is to memorize the 16 four-bit patterns in the table above; once you know them, you can convert any hex value to binary at sight, digit by digit, with no arithmetic at all.

Common Hex Mistakes

A classic error is confusing the letter O with the digit 0, or the letter I with 1. Hex only uses the letters A to F, so if you see a G or an O, something has been mistyped. Another frequent slip is forgetting that A to F are worth 10 to 15, and treating hex 10 as ten rather than sixteen. When in doubt, convert the value back to decimal to double-check.

Why Use Our Hex Converter?

Our hex converter works in both directions with very large numbers, accepts 0x prefixes and lowercase letters, and shows binary and octal at the same time. The step-by-step explanation makes the math easy to follow. It's built for developers, web designers, network engineers and computer science students who need fast, accurate hex conversions.

Frequently Asked Questions

Quick answers to common questions related to Hex Converter are as under:-

What is hexadecimal?

Hexadecimal is a base-16 number system that uses the digits 0–9 and the letters A–F, where A to F stand for the values 10 to 15.

How do you convert hex to decimal?

Multiply each hex digit by 16 raised to its position, starting from 0 on the right, and add the results. For 2F, that is 2 × 16 + 15 = 47.

How do you convert decimal to hex?

Divide the number by 16 repeatedly and write each remainder as a hex digit. Read the remainders from the last to the first. 255 becomes FF.

What is FF in decimal?

FF in hexadecimal equals 255 in decimal. It is the largest value that fits in one byte.

Why do programmers use hexadecimal?

Each hex digit represents exactly four binary digits, so hex is a short, readable way to write binary values such as memory addresses, colors and byte data.

What does 0x mean before a number?

The 0x prefix shows that a number is written in hexadecimal. For example, 0x1A means the hex number 1A, which is 26 in decimal.

Latest from Our Blog

Explore helpful tips, updates, and guides on calculators, AI tools, and conversions.