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.
How to Use the Binary Hex Decimal Converter
- 1. Enter a number - type a value in any of the three fields: binary, decimal, or hexadecimal.
- 2. See instant conversions - the other two fields update automatically with the equivalent value.
- 3. Verify format - binary accepts only 0s and 1s; hex accepts 0-9 and A-F; decimal accepts 0-9.
- 4. Convert another number - clear the fields and enter a new value in any base.
- 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
| Decimal | Binary | Hexadecimal | Notes |
|---|---|---|---|
| 0 | 0000 | 0 | Zero in all bases |
| 10 | 1010 | A | First letter digit in hex |
| 15 | 1111 | F | Maximum single hex digit |
| 16 | 10000 | 10 | One hex “column” turns over |
| 42 | 101010 | 2A | Fits in 6 bits |
| 127 | 1111111 | 7F | Max signed 8-bit value |
| 128 | 10000000 | 80 | Min unsigned 8-bit high half |
| 255 | 11111111 | FF | Max 1-byte (8-bit) value |
| 256 | 100000000 | 100 | First 9-bit number |
| 65535 | 1111111111111111 | FFFF | Max 16-bit (2-byte) value |
When to Use
- Reading or writing CSS/HTML color codes such as
#FF5733where 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
chmodpermissions in Unix, IPv4 subnet masks, or MAC address notation.
Common Mistakes
- Confusing hex letters with decimal. The hex digit
Aequals 10, not 1. Writing#FF2A00and reading the2Aas “two-A” rather than 42 leads to wrong color math. Always translate letter digits to their decimal values first. - Forgetting leading zeros in nibble grouping. When converting binary to hex, pad the leftmost group to 4 bits. The binary number
1011must be grouped as1011(4 bits = B), not split incorrectly as1011. - Mixing up base prefixes. In code,
0xFFmeans hex 255,0b11111111means binary 255, and bare255means decimal 255. Dropping or misreading the prefix causes silent bugs that are hard to trace. - Assuming “0x” is part of the value. The
0xprefix is a notation convention, not digits. The number0x1Fis 31 in decimal — the0xcontributes nothing to the numeric value.
Quick Reference Benchmarks
| Bits | Bytes | Max Decimal | Max Hex | Common Use |
|---|---|---|---|---|
| 4 | 0.5 (nibble) | 15 | F | Single hex digit |
| 8 | 1 | 255 | FF | One byte, RGB channel, ASCII |
| 16 | 2 | 65,535 | FFFF | Port numbers, Unicode BMP |
| 24 | 3 | 16,777,215 | FFFFFF | 24-bit color (16M colors) |
| 32 | 4 | 4,294,967,295 | FFFFFFFF | IPv4 address, 32-bit int |
Tips
- 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.
- 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.
- 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.
- 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
#3A7FC1is always exactly 3 bytes of RGB data. - Most programming languages accept hex literals directly:
0xFFin 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. - 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?
How do you count in binary?
How are hexadecimal numbers used for web colors?
How do you manually convert between binary, decimal, and hex?
Where are binary and hexadecimal used in programming?
Explore More Math & Science Tools
Related Math & Science Calculators
Age Calculator
Free online Age Calculator -- find your exact age in years, months, days, weeks, and total days from your date of birth. Includes next birthday countdown and milestone tracking.
Math & ScienceBasic Calculator
Free online Basic Calculator -- perform addition, subtraction, multiplication, division, exponents, and modulo operations. Instant results with up to 10 decimal places of precision.
Math & ScienceDate Calculator
Free online Date Calculator -- find the exact number of days, weeks, months, and years between any two dates. Calculate date differences for project planning, contracts, age verification, and event countdowns.
Math & ScienceFraction Calculator
Free online Fraction Calculator -- add, subtract, multiply, and divide fractions with automatic simplification. Shows results as fractions and decimals. Supports mixed numbers and improper fractions.