Hex, Binary, Decimal Converter

Convert between different number systems

Embed this calculator

How to Use This Calculator

This hex binary converter makes it easy to transform numbers between decimal, hexadecimal, binary, and octal formats. Whether you are a programmer debugging code, a student learning computer science, or someone working with digital systems, this tool provides instant conversions.

Entering Decimal Numbers: Type any whole number using digits 0 through 9. For example, enter 255 to see its equivalent in all other bases. Decimal is the default input format, so you can start converting immediately.

Entering Hexadecimal Values: Select the Hex button, then enter your value using digits 0-9 and letters A-F. You can use uppercase or lowercase letters. Try entering FF, 1A3F, or DEADBEEF to see the conversions.

Entering Binary Numbers: Select the Binary button and enter only 0s and 1s. For example, 11111111 converts to 255 decimal and FF hexadecimal. Spaces are not required between digit groups.

Entering Octal Numbers: Select the Octal button and use digits 0 through 7 only. Enter values like 377 (which equals 255 decimal) to see conversions across all four number systems.

Understanding Number Systems

Number systems provide different ways to represent the same numerical values. While we use decimal (base-10) in everyday life, computers and programmers rely on alternative systems that align better with digital hardware and software requirements.

Binary (Base-2): Binary forms the absolute foundation of computing. Every computer chip, processor, and memory module operates using electrical signals that are either on or off, high or low, true or false. Binary represents these two states perfectly with just two digits: 0 and 1. Each binary digit is called a bit. When you save a file, stream music, or browse the web, all that data ultimately exists as billions of binary digits stored and processed by your device. While binary numbers become unwieldy for humans (the number 1000 requires 10 binary digits: 1111101000), computers process them with incredible speed and accuracy.

Hexadecimal (Base-16): Programmers love hexadecimal because it provides a compact way to represent binary data. Using digits 0-9 plus letters A-F (representing values 10-15), each hex digit corresponds exactly to four binary bits. This relationship makes conversion straightforward and keeps numbers manageable. Instead of writing 11111111 in binary, you simply write FF in hexadecimal. Web developers encounter hex daily in color codes like #FF5733. Memory addresses, MAC addresses, and Unicode characters all use hexadecimal notation. When examining computer memory or debugging low-level code, hex provides the perfect balance between human readability and precise binary representation.

Octal (Base-8): Octal uses digits 0 through 7, with each digit representing exactly three binary bits. While less common than hexadecimal in modern programming, octal remains essential for Unix and Linux file permissions. The familiar chmod 755 command uses octal notation, where 7 means read+write+execute and 5 means read+execute. Octal also appears in some programming languages as a way to specify character codes and escape sequences.

Decimal (Base-10): The decimal system you use every day employs ten digits (0-9) and powers of ten for place values. While natural for humans who evolved counting on ten fingers, decimal does not map efficiently to binary hardware. Converting between decimal and binary requires mathematical division, whereas hex and octal convert directly through digit grouping. Understanding all four systems helps you work effectively across different computing contexts.

Frequently Asked Questions

Why do computers use binary instead of decimal?
Computer processors contain billions of transistors that function as tiny switches with two states: on and off. Binary maps directly to this physical reality, where 1 represents on (voltage present) and 0 represents off (no voltage). Building reliable hardware to distinguish between ten different voltage levels for decimal would be far more complex, expensive, and error-prone. Binary's simplicity enables the incredible speed and reliability of modern computing.

Why do programmers use hexadecimal so often?
Hexadecimal strikes the perfect balance between compactness and precision. Each hex digit represents exactly 4 bits, so a byte (8 bits) requires only 2 hex digits instead of 8 binary digits. This makes hex ideal for displaying memory contents, specifying colors, writing MAC addresses, and representing any binary data in human-readable form. The pattern 0xFF is much easier to type and remember than 11111111.

How do I manually convert binary to hexadecimal?
Group binary digits into sets of four, starting from the right. Pad with leading zeros if needed. Then convert each group: 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. For example, binary 11010110 becomes 1101 0110, which converts to D6 in hexadecimal.

What exactly is a byte?
A byte is a unit of digital information consisting of 8 bits. It can represent values from 0 to 255 (decimal), 00 to FF (hexadecimal), or 00000000 to 11111111 (binary). Bytes serve as the fundamental building blocks of data storage, with larger units like kilobytes, megabytes, and gigabytes representing 1024 bytes, 1024 kilobytes, and 1024 megabytes respectively.

How do hex color codes work?
Hex color codes like #FF5733 contain three pairs of hexadecimal digits representing red, green, and blue intensity values. Each pair ranges from 00 (none) to FF (maximum, or 255 decimal). In #FF5733, red is FF (255), green is 57 (87), and blue is 33 (51), creating a bright orange color. Pure red is #FF0000, pure green is #00FF00, and pure blue is #0000FF.

What is the difference between signed and unsigned numbers?
Unsigned numbers use all bits to represent positive values only. An unsigned byte ranges from 0 to 255. Signed numbers reserve the leftmost bit to indicate positive (0) or negative (1) values using two's complement notation. A signed byte ranges from -128 to +127. The same bit pattern 11111111 means 255 as unsigned but -1 as signed.

What is the difference between a bit and a byte?
A bit is the smallest unit of data, representing a single binary digit (0 or 1). A byte contains 8 bits and can represent 256 different values. Internet speeds are measured in bits per second (Mbps), while storage uses bytes (GB). To convert bits to bytes, divide by 8. A 100 Mbps connection transfers about 12.5 megabytes per second.

What are some common hex values I should know?
Several hex values appear frequently in computing: FF equals 255 (maximum byte value), 00 equals 0 (minimum), 80 equals 128 (half of 256), 7F equals 127 (maximum signed byte), 10 equals 16 (one hex digit overflow), and 100 equals 256 (one byte overflow). Color-wise, FFFFFF is white, 000000 is black, and FF0000, 00FF00, 0000FF are pure red, green, and blue.

Number System Examples

Web Color Codes: The color coral (#FF7F50) breaks down as FF (255) red, 7F (127) green, and 50 (80) blue. CSS also accepts rgb(255, 127, 80) for the same color. Converting between hex and decimal RGB values is a daily task for web designers.

IP Address Octets: IP addresses like 192.168.1.1 contain four decimal numbers, each representing one byte (0-255). In networking tools, you might see these as hex: C0.A8.01.01. Understanding this helps when examining network packets or configuring routers.

File Sizes and Memory: A kilobyte is 1024 bytes (400 hex, 10000000000 binary). When debugging programs, memory addresses appear in hex like 0x7FFEE4B2A000. Reading these addresses becomes natural once you understand hex groupings represent byte boundaries.

ASCII Character Codes: The letter 'A' is ASCII code 65 decimal, 41 hexadecimal, or 1000001 binary. Lowercase 'a' is 97 decimal or 61 hex. Space is 32 decimal or 20 hex. These codes underpin how computers store and transmit text.

Programming Tips

Recognizing Number Formats: Most programming languages use prefixes to distinguish bases. The prefix 0x (or 0X) indicates hexadecimal: 0xFF equals 255. The prefix 0b indicates binary: 0b11111111 also equals 255. Octal traditionally uses a leading zero: 0377 equals 255. Without prefixes, numbers are decimal.

Useful Binary Patterns: Powers of 2 create simple binary numbers: 1, 10, 100, 1000 (decimal 1, 2, 4, 8). One less than a power of 2 fills all lower bits: 1, 11, 111, 1111 (decimal 1, 3, 7, 15). These patterns are essential for bitwise operations, masks, and flags in programming.

Quick Mental Conversions: Memorize key values: F=15, 10=16, FF=255, 100=256. For hex to binary, convert each digit separately: A3 becomes 1010 0011. For quick decimal estimates, remember that 0x100 is about 256, 0x1000 is about 4096, and 0x10000 is about 65536.

Debugging with Hex: When examining memory dumps or binary files, hex editors display data as paired hex digits (bytes). Look for ASCII text as values 20-7E, null bytes as 00, and common markers like FFFE (Unicode BOM) or 504B (ZIP file signature).

Did You Know?

  • The word "bit" is a portmanteau of "binary digit," coined by mathematician John Tukey in 1947.
  • Hexadecimal uses letters A through F because we needed 16 symbols but the decimal system only has 10 numeric digits.
  • The maximum value of a byte (8 bits) is 255 decimal, FF hex, or 11111111 binary, appearing throughout computing from color values to IP addresses.
  • Ancient Mayans used a base-20 (vigesimal) number system, while Babylonians used base-60, which is why we have 60 seconds in a minute.
  • The first electronic computers in the 1940s actually used decimal arithmetic internally, but engineers quickly discovered that binary was far more reliable.
Created by
The Ugly Empire Team
Software engineers and data specialists with backgrounds in financial services, mathematics, and educational technology. Our team builds tools using industry-standard formulas verified against authoritative sources.
Last reviewed: January 2026
Regular accuracy audits
Formulas from authoritative sources
Privacy-first: calculations run locally
Disclaimer: This calculator provides estimates for informational purposes only. Results should not be considered financial, legal, medical, or professional advice. Always consult qualified professionals for important decisions. We strive for accuracy but cannot guarantee results will match real-world outcomes due to varying factors and individual circumstances.