Binary ↔ Hexadecimal Converter

Convert between binary (base 2) and hexadecimal (base 16) instantly

Hexadecimal (hex) is used extensively in computing — from memory addresses and colour codes (like #FF5733) to assembly language and debugging. Binary is the language of computers. This converter helps you switch between both systems instantly.

Loading calculator...

How It Works

1
Select your source number system (Binary or Hex) from the dropdown
2
Enter your number in the input field — conversion happens instantly
3
View the result in the target number system
4
Use the Swap button to reverse the conversion direction
5
Copy the result to your clipboard with one click
6
Clear the input to start a new conversion

The Binary-Hex Formula

How to convert between binary and hexadecimal

Formula

Hex = 4-bit binary chunks converted | Binary = each hex digit to 4-bit binary

Variables

4 bits = 1 hex digit

Grouping Rule

Every hexadecimal digit represents exactly 4 binary bits (a nibble). This is why hex is so useful — it compresses long binary strings into readable form.

Hex digits: 0-9, A-F

Hexadecimal Digits

Hex uses 0-9 for values 0-9 and A-F for values 10-15. A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.

Binary chunking

Binary to Hex Conversion

Group binary digits into sets of 4 (from the right), convert each chunk to its hex equivalent. Add leading zeros to the leftmost group if needed to make 4 bits.

Note: Hexadecimal is the preferred human-readable representation of binary because it is 4× more compact. 8 bits (one byte) is exactly two hex digits: FF = 255, 00 = 0, perfectly mapping to colour values, memory addresses, and network protocols.

Step-by-Step Example

Converting binary 11011010 to hexadecimal

1

Write the binary number

Binary: 1101 1010

2

Split into groups of 4 bits from the right

First group: 1101 | Second group: 1010

3

Convert first group 1101 to hex

1101 binary = 8+4+0+1 = 13 decimal = D in hex

4

Convert second group 1010 to hex

1010 binary = 8+0+2+0 = 10 decimal = A in hex

5

Combine results

Binary 11011010 = Hex DA

Reference Guide

unitvaluenote
Binary 0000Hex 04 bits → 1 hex digit
Binary 0001Hex 11 decimal
Binary 0010Hex 22 decimal
Binary 0011Hex 33 decimal
Binary 0100Hex 44 decimal
Binary 0101Hex 55 decimal
Binary 0110Hex 66 decimal
Binary 0111Hex 77 decimal
Binary 1000Hex 88 decimal
Binary 1001Hex 99 decimal
Binary 1010Hex A10 decimal
Binary 1011Hex B11 decimal
Binary 1100Hex C12 decimal
Binary 1101Hex D13 decimal
Binary 1110Hex E14 decimal
Binary 1111Hex F15 decimal

Understanding Hexadecimal

Where hex is used in real computing

🎨 Web Colours (RGB hex: #FF5733)

Hex codes in web design are six-digit numbers: #RRGGBB where each pair (RR, GG, BB) is a hex value from 00 to FF (0–255 decimal). FF = 255 = maximum intensity. 00 = 0 = minimum intensity.

Best for: Example: #FF0000 is pure red, #00FF00 is pure green, #0000FF is pure blue, #FFFFFF is white, #000000 is black.

🧠 Memory Addresses and Pointers

Memory addresses in debugging tools, crash dumps, and compiler outputs are almost always displayed in hexadecimal. A memory address like 0x7FFD8A3F2B1C is far more compact than its binary equivalent.

Best for: The '0x' prefix indicates a hexadecimal number in many programming languages. 0xFF = 255 decimal.

Assembly Language and Machine Code

Machine code (raw processor instructions) is usually represented in hex in debuggers, disassemblers, and hex editors. This allows programmers to read the actual bytes being executed by the CPU.

Best for: 8086 processor instruction 'mov ax, 1' in hex: B8 01 00. Each byte is a hex value (B8, 01, 00).

🌐 Network Protocols (MAC Addresses, IPv6)

MAC addresses (permanent hardware addresses for network devices) are six pairs of hex digits. IPv6 addresses are eight groups of four hex digits, totalling 128 bits.

Best for: MAC address example: 00:1A:2B:3C:4D:5E. IPv6 example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334.

Advertisement

Why Hexadecimal Is Used in Computing

Hexadecimal (base 16) is the standard human-readable representation of binary because it is perfectly aligned with bytes: one byte (8 bits) equals exactly two hex digits (8 ÷ 4 = 2). This makes hex 4× more compact than binary while preserving exact correspondence. Binary: 11111111 (8 characters) Hex: FF (2 characters) The hex digits 0-9 represent their values, while A=10, B=11, C=12, D=13, E=14, F=15. This is easier to read, write, and remember than long strings of binary digits. Hexadecimal is used everywhere in computing: memory addresses in debuggers, colour codes in web design (#FF5733), MAC addresses (00:1A:2B:3C:4D:5E), IPv6 addresses, assembly language, machine code, binary file viewers (hex editors), and data encoding formats. Web colours are particularly intuitive: #RRGGBB where RR = red intensity (00–FF), GG = green (00–FF), BB = blue (00–FF). FF = 255 decimal = maximum intensity. This allows 16.7 million distinct colours. Understanding hex is essential for programmers working with low-level code, web developers, network engineers, and anyone who needs to read memory dumps, register values, or packet captures.

Key Features

Instant real-time conversion between binary and hex
Swap between binary → hex and hex → binary
Copy results to clipboard with one click
Support for large numbers (up to 64 bits / 16 hex digits)
Input validation prevents invalid characters
Mobile responsive design
All number systems displayed simultaneously for reference

💡 Pro Tips

  • Memorise the 16 binary-to-hex pairs: 0000=0, 0001=1, 0010=2, 0011=3, 0100=4, 0101=5, 0110=6, 0111=7, 1000=8, 1001=9, 1010=A, 1011=B, 1100=C, 1101=D, 1110=E, 1111=F
  • In web colour codes, #FF = 255, #00 = 0. #FFFFFF is white, #000000 is black, #FF0000 is red.
  • Many debuggers show memory addresses in hex starting with '0x' (e.g., 0x7FFD8A3F2B1C). Our calculator outputs hex without the prefix, but you can add it when needed.
  • Every byte (8 bits) is exactly two hex digits. This is why hex is so efficient — it aligns perfectly with computer architecture.
  • Use the Quick Examples to learn common patterns: FF = 255, 00 = 0, 3F = 63 (often used in networking), FFFF = 65,535

Common Mistakes

Entering letters beyond A-F in hex input

Hexadecimal only uses digits 0-9 and letters A-F (uppercase or lowercase). Letters G-Z will trigger a validation error. Use our dropdown examples to learn the valid characters.

Confusing hex letters with decimal values

In hex, A=10, B=11, C=12, D=13, E=14, F=15. This is not the same as the decimal number system where A has no meaning. Our converter handles this correctly.

Forgetting that hex is case-insensitive

Our converter accepts both uppercase (A-F) and lowercase (a-f) hex letters. The output is always uppercase for consistency.

Expecting hex to have decimal points

Hex is an integer base. It represents whole numbers only. Decimal points (floating point) are not supported — use our Decimal to Binary converter for fractional numbers.

Research & Citations

All factual claims on this page are sourced from peer-reviewed research

  1. [1]

    IEEE Standard for Floating-Point Arithmetic (2019). IEEE 754-2019.

    Standard for floating-point representation, which uses hexadecimal for binary interchange format

This calculator is a reference tool and does not constitute medical advice. For personalised sleep health guidance, consult a qualified healthcare provider.

Last updated: January 10, 2025

C

Creators

CalcPool Team

Developer

Advertisement

Quick Facts

CategoryDigital
Total uses0
Last updated2025-01-10
Cost Free
Advertisement

Privacy Guaranteed

Your data never leaves your browser. All calculations are 100% private.

Frequently Asked Questions

How do I convert binary to hexadecimal?

Group binary digits into sets of 4 from the right, then convert each 4-bit group to its hex digit (0-F). For example, binary 11011010 → groups 1101 (D) and 1010 (A) → hex DA.

How do I convert hexadecimal to binary?

Convert each hex digit to its 4-bit binary equivalent and concatenate. For example, hex DA → D = 1101, A = 1010 → binary 11011010.

What is hex used for in programming?

Hex is used almost everywhere low-level: memory addresses, register values, colour codes (#FF5733), MAC addresses, IPv6 addresses, assembly language, machine code, and binary file editors.

What does 0x mean before hex numbers?

In many programming languages (C, C++, Java, Python, JavaScript), the prefix '0x' indicates that the following number is hexadecimal. 0xFF means "hex FF" (decimal 255). Our converter outputs plain hex without the prefix, but you can add it manually.

What is the binary representation of hex FF?

Hex FF = decimal 255 = binary 11111111 (eight 1s). This is one full byte of data — used extensively in web colours, network masks, and binary data representation.

Advertisement