Skip to content

Binary Hex Decimal Converter

Free online Binary, Hexadecimal, and Decimal Converter -- convert between base-2, base-10, and base-16 number systems instantly. Essential for programming, computer science, and digital electronics.

Loading calculator

Preparing Binary Hex Decimal Converter...

Reviewed & Methodology

Every calculator is built using industry-standard formulas, validated against authoritative sources, and reviewed by a credentialed financial professional. All calculations run privately in your browser - no data is stored or shared.

Last reviewed:

Reviewed by:

Written by:

How to Use the Binary Hex Decimal Converter

  1. 1. Enter a number - type a value in any of the three fields: binary, decimal, or hexadecimal.
  2. 2. See instant conversions - the other two fields update automatically with the equivalent value.
  3. 3. Verify format - binary accepts only 0s and 1s; hex accepts 0-9 and A-F; decimal accepts 0-9.
  4. 4. Convert another number - clear the fields and enter a new value in any base.
  5. 5. Use for programming - reference the hex or binary output when working with code, colors, or memory addresses.

Binary Hex Decimal Converter

Convert numbers between binary (base 2), decimal (base 10), and hexadecimal (base 16) instantly. Enter a value in any base and the other two fields update automatically. This converter is used daily by software developers reading memory addresses, web designers decoding color codes, electronics engineers analyzing register values, and computer science students working through coursework.

How Number Base Conversion Works

Every number system assigns a place value to each digit position based on the base (radix). Binary multiplies each digit by powers of 2, decimal by powers of 10, and hexadecimal by powers of 16.

Decimal to binary — divide repeatedly by 2, collect remainders bottom-up. Example: 45 / 2 = 22 r1, 22 / 2 = 11 r0, 11 / 2 = 5 r1, 5 / 2 = 2 r1, 2 / 2 = 1 r0, 1 / 2 = 0 r1. Reading remainders upward gives 101101. Check: 32 + 8 + 4 + 1 = 45. Correct.

Binary to hex — group binary digits into sets of 4 from the right, then replace each group with its hex digit. Example: 101101 becomes 0010 1101 = 2D in hex.

Hex to decimal — multiply each digit by its power of 16 and sum. Example: 2D = (2 x 16) + (13 x 1) = 32 + 13 = 45.

Worked Examples

Example 1 — Web color code. A designer sees the CSS color #1A8FE3. Split into pairs: 1A = 26 red, 8F = 143 green, E3 = 227 blue. This is a medium-bright blue used in many UI button palettes.

Example 2 — Unix file permissions. chmod 755 sets permissions. 7 in binary is 111 (read + write + execute), 5 is 101 (read + execute). Knowing binary makes it immediately clear which permission bits are set without memorizing tables.

Example 3 — Debugging a register value. A microcontroller datasheet says a status register holds 0xC4. In binary that is 11000100. Bits 7, 6, and 2 are set. If those bits correspond to “overflow,” “carry,” and “interrupt pending,” the engineer can read the state directly from the bit pattern.

Reference Table

DecimalBinaryHexadecimalNotes
000000Zero in all bases
101010AFirst letter digit in hex
151111FMaximum single hex digit
161000010One hex “column” turns over
421010102AFits in 6 bits
12711111117FMax signed 8-bit value
1281000000080Min unsigned 8-bit high half
25511111111FFMax 1-byte (8-bit) value
256100000000100First 9-bit number
655351111111111111111FFFFMax 16-bit (2-byte) value

When to Use

  • Reading or writing CSS/HTML color codes such as #FF5733 where each pair is one byte of RGB data.
  • Debugging memory dumps, hex editors, or binary files where addresses are shown in hex.
  • Setting or reading bitfields in hardware registers, network packets, or file format headers.
  • Working through computer science coursework on number systems, bitwise operations, or data representation.
  • Understanding chmod permissions in Unix, IPv4 subnet masks, or MAC address notation.

Common Mistakes

  1. Confusing hex letters with decimal. The hex digit A equals 10, not 1. Writing #FF2A00 and reading the 2A as “two-A” rather than 42 leads to wrong color math. Always translate letter digits to their decimal values first.
  2. Forgetting leading zeros in nibble grouping. When converting binary to hex, pad the leftmost group to 4 bits. The binary number 1011 must be grouped as 1011 (4 bits = B), not split incorrectly as 10 11.
  3. Mixing up base prefixes. In code, 0xFF means hex 255, 0b11111111 means binary 255, and bare 255 means decimal 255. Dropping or misreading the prefix causes silent bugs that are hard to trace.
  4. Assuming “0x” is part of the value. The 0x prefix is a notation convention, not digits. The number 0x1F is 31 in decimal — the 0x contributes nothing to the numeric value.

Quick Reference Benchmarks

BitsBytesMax DecimalMax HexCommon Use
40.5 (nibble)15FSingle hex digit
81255FFOne byte, RGB channel, ASCII
16265,535FFFFPort numbers, Unicode BMP
24316,777,215FFFFFF24-bit color (16M colors)
3244,294,967,295FFFFFFFFIPv4 address, 32-bit int

Tips

  1. Memorize the 16 hex-to-binary digit mappings: 0=0000 through 9=1001, A=1010, B=1011, C=1100, D=1101, E=1110, F=1111. These 16 patterns cover everything.
  2. Powers of 2 appear as a 1 followed by zeros in binary (2=10, 4=100, 8=1000, 16=10000). They are useful sanity-check anchors when doing manual conversions.
  3. If a decimal number ends in an even digit, its binary form ends in 0. If it ends in an odd digit, its binary form ends in 1. Use this to quickly spot-check your work.
  4. One hex digit equals exactly one nibble (4 bits), and two hex digits equal exactly one byte (8 bits). A 6-digit hex color like #3A7FC1 is always exactly 3 bytes of RGB data.
  5. Most programming languages accept hex literals directly: 0xFF in C, Python, and JavaScript all equal 255. Use hex literals instead of decimal when working with bitmasks — they are easier to read and less error-prone.
  6. To convert a large binary number to hex without a calculator, split from the right into groups of 4, convert each group independently, and concatenate the hex digits. This works for any length.

Frequently Asked Questions

What are number bases and why do we use different ones?
A number base (or radix) determines how many digits are used to represent values. Decimal (base 10) uses digits 0-9 and is the standard for everyday counting. Binary (base 2) uses only 0 and 1, which maps directly to the on/off states of electronic circuits -- making it the native language of computers. Hexadecimal (base 16) uses 0-9 and A-F, and is a compact way to represent binary data since each hex digit corresponds to exactly 4 binary digits.
How do you count in binary?
Binary counting follows the same principle as decimal but with only two digits (0 and 1). When a digit reaches 1, the next increment carries over to the left: 0, 1, 10, 11, 100, 101, 110, 111, 1000. Each position represents a power of 2 from right to left: 1, 2, 4, 8, 16, 32, and so on. To convert binary to decimal, multiply each digit by its positional value and sum the results. For example, 1011 in binary = (1x8) + (0x4) + (1x2) + (1x1) = 11 in decimal.
How are hexadecimal numbers used for web colors?
Web colors are represented as 6-digit hex values preceded by a hash symbol, like #FF5733. The six digits are split into three pairs: the first two represent red intensity (FF = 255), the middle two represent green (57 = 87), and the last two represent blue (33 = 51). Each pair ranges from 00 (0, no intensity) to FF (255, full intensity). So #000000 is black, #FFFFFF is white, #FF0000 is pure red, and #00FF00 is pure green.
How do you manually convert between binary, decimal, and hex?
To convert decimal to binary, repeatedly divide by 2 and record the remainders from bottom to top. For example, 25: 25/2=12 r1, 12/2=6 r0, 6/2=3 r0, 3/2=1 r1, 1/2=0 r1, so 25 = 11001. To convert binary to hex, group binary digits into sets of 4 from the right and convert each group: 11001 = 0001 1001 = 19 in hex. To convert hex to decimal, multiply each digit by its power of 16: 19 hex = (1x16) + (9x1) = 25 decimal.
Where are binary and hexadecimal used in programming?
Binary is used for bitwise operations (AND, OR, XOR, NOT), file permissions (chmod 755 in Unix = 111 101 101 in binary), and understanding how data is stored in memory at the bit level. Hexadecimal is used for memory addresses (0x7FFF), color codes (#FF5733), MAC addresses (00:1A:2B:3C:4D:5E), Unicode characters (U+0041 = 'A'), and reading hex dumps of binary files. Most programming languages support hex literals (0xFF) and binary literals (0b11111111) directly in code.
Calculators