Binary To HEX
Convert binary (0s and 1s) to HEX instantly. Paste your binary values (with or without spaces) and get the hexadecimal output in seconds. Perfect for developers, debugging, networking, and learning how data is represented in computers. Free, fast, and easy to use.
The Binary to Hex Converter transforms binary numbers (base-2) into hexadecimal (base-16). Paste binary digits — 0s and 1s — with or without spaces, click Convert, and get the hex output immediately. You can also upload a text file containing binary.
The conversion exploits a fundamental property of these number systems: 4 binary digits (a nibble) map exactly to 1 hexadecimal digit. This makes binary-to-hex conversion one of the cleanest and most useful transformations in computing — hex is the standard shorthand for binary used by programmers, debuggers, network analysts, and hardware engineers worldwide.
How to use the Binary to Hex Converter
Paste your binary into the input field. Input should contain only the characters 0 and 1. Spaces between groups are optional — include them if they help readability, omit them if pasting from a log or file.
If your binary length is not a multiple of 4, pad the leftmost group with leading zeros. For example, 101 becomes 0101 before conversion.
Click Convert to Hex.
Copy the hex output for use in code, documentation, debugging, or further conversion.
The fundamental rule — 4 binary bits = 1 hex digit
The relationship between binary and hexadecimal is exact and elegant: 4 binary digits (called a nibble) represent exactly one hexadecimal digit. This works because both the maximum value of a 4-bit binary number (1111 = 15) and the maximum single hex digit (F = 15) are the same. There is no rounding, no approximation, and no information lost — one is simply a different notation for the same value.
Worked example — converting 10101100 to hex: Group the 8 bits into two 4-bit nibbles: 1010 | 1100. Convert each nibble independently: 1010 = 10 in decimal = A in hex. 1100 = 12 in decimal = C in hex. Result: AC. The 8-bit binary 10101100 equals the 2-character hex AC. This is the core operation — convert each 4-bit group to its hex digit, read left to right.
Complete 4-bit nibble to hex reference table
Every possible 4-bit binary value (0000 through 1111) maps to exactly one hex digit (0 through F). The hex digits A through F (shown in red below) represent the decimal values 10 through 15:
| Binary | Dec | Hex | Binary | Dec | Hex | Binary | Dec | Hex | Binary | Dec | Hex |
| 0000 | 0 | 0 | 0001 | 1 | 1 | 0010 | 2 | 2 | 0011 | 3 | 3 |
| 0100 | 4 | 4 | 0101 | 5 | 5 | 0110 | 6 | 6 | 0111 | 7 | 7 |
| 1000 | 8 | 8 | 1001 | 9 | 9 | 1010 | 10 | A | 1011 | 11 | B |
| 1100 | 12 | C | 1101 | 13 | D | 1110 | 14 | E | 1111 | 15 | F |
Step-by-step manual conversion method
Write the binary number. If the total number of bits is not a multiple of 4, add leading zeros to the leftmost group until it is. Example: 11011 (5 bits) → 0001 1011 (8 bits with leading zero pad).
Group the bits into sets of 4, starting from the rightmost bit. Example: 11001010 → 1100 | 1010.
Convert each 4-bit group to its hex digit using the lookup table above. 1100 → C. 1010 → A.
Write the hex digits in order from left to right. 1100 1010 → CA.
Worked conversion examples
| Binary input | Grouped in 4s | Hex digit(s) | Hex output |
| 1111 | 1111 | F | F |
| 1010 | 1010 | A | A |
| 11001010 | 1100 1010 | C A | CA |
| 10101100 | 1010 1100 | A C | AC |
| 1111 0000 1010 1011 | 1111 0000 1010 1011 | F 0 A B | F0AB |
| 101 | 0101 (padded) | 5 | 5 |
| 110110111011 | 1101 1011 1011 | D B B | DBB |
Why hexadecimal is used in computing
Long binary strings — the native representation of data in computers — are difficult for humans to read and work with. A 32-bit memory address written in binary is 32 characters of 0s and 1s; in hex it is 8 characters. A 256-bit SHA-256 hash is 256 binary digits; in hex it is 64 characters. Hex reduces the character count to one quarter while preserving the exact value and maintaining a lossless, exact relationship with binary.
Hex vs binary readability: The value 11111111 11110000 10101010 11001101 as binary is 32 characters, difficult to read and error-prone to type. As hex it is FF F0 AA CD — 8 meaningful characters that are easy to compare, type, and remember. Both represent exactly the same number. This compression without approximation is why every debugger, disassembler, network analyser, and hex editor displays binary data as hex.
When binary-to-hex conversion is needed
| Context | Why binary-to-hex helps |
| Memory addresses and dumps | Memory addresses in virtually all programming environments are displayed in hexadecimal. A 32-bit address like 00000000111100001010101011001101 is unreadable in binary but immediately workable as 00F0AACD in hex. Debuggers, disassemblers, and hex editors all use hex to display memory content. |
| Network packet analysis | Network protocols define fields at the bit and byte level. A packet captured with Wireshark or tcpdump is represented as hex bytes — reading raw binary from a 1,500-byte Ethernet frame is impractical. Hex reduces 8 bits to 2 characters, making byte-level protocol fields readable. |
| Assembly and machine code | Assembly language mnemonics encode to binary machine code instructions. Opcodes and operands are almost always written in hex in assembler output, debugging sessions, and processor documentation. Converting binary instruction encodings to hex is routine in low-level programming. |
| Colour codes | CSS and HTML colour codes are 6-digit hex values (e.g. #FF5733). Each pair of hex digits represents one byte (0–255) for one colour channel. Binary to hex conversion is relevant when working with colour manipulation at the bit level — for example, extracting individual channel values from a packed 24-bit binary colour representation. |
| Cryptography and hashing | Hash outputs (MD5, SHA-1, SHA-256) and cryptographic keys are large binary numbers conventionally displayed in hex. A SHA-256 hash is 256 bits (32 bytes) — 64 hex characters — versus 256 binary digits. Converting binary hash output to hex for display and comparison is standard practice. |
| Embedded systems and hardware | Microcontroller register values, I2C/SPI data frames, and hardware configuration bytes are defined in binary in datasheets but programmed and debugged in hex. Converting binary bit patterns from a hardware specification to hex for code or documentation is a daily task in embedded development. |
Usage limits
| Guest (no account) | Registered (free) | |
| Daily conversions | 25 per day | 100 per day |
| Words per conversion | 200 words | 1000 words |
Related tools
Hex to Binary — convert hexadecimal values back to binary. The reverse of this tool — one hex digit expands to exactly 4 binary bits.
Binary to Text — decode binary-encoded text (ASCII/UTF-8). For text encoding, binary is typically grouped as 8-bit bytes (2 hex digits per character).
Decimal to Hex — convert base-10 numbers to hexadecimal without going through binary first.
Binary to Decimal — convert binary numbers to their standard base-10 decimal equivalent.
Frequently asked questions
How does binary to hex conversion work?
Binary and hexadecimal share an exact relationship: 4 binary digits (a nibble) always equal 1 hex digit. To convert, group the binary digits into sets of 4 starting from the right, then replace each group with its hex equivalent using the lookup table (0000 = 0, 0001 = 1, ... 1010 = A, 1011 = B, 1100 = C, 1101 = D, 1110 = E, 1111 = F). The hex digits are written in the same left-to-right order as the binary groups. No information is lost — the conversion is exact and reversible.
Why do hex digits go up to F instead of stopping at 9?
Hexadecimal is base-16, meaning it needs 16 distinct symbols for each digit position. The symbols 0–9 cover values 0 through 9, but 4 binary bits can represent values up to 15 (1111 = 15). The letters A through F are used for values 10 through 15, giving hex exactly 16 symbols per digit position. This is why A = 10, B = 11, C = 12, D = 13, E = 14, and F = 15 in hexadecimal.
What is a nibble and why does it matter for hex?
A nibble is a group of 4 binary bits — half of a byte. The significance of a nibble is that 4 bits can represent exactly 16 values (0000 through 1111, decimal 0 through 15), which is exactly the range of one hex digit. This makes nibbles the natural grouping unit for hex conversion. A full byte (8 bits) is two nibbles and converts to exactly two hex digits. This is why hex bytes are always written as pairs (00 through FF), and why hex is the universally preferred compact notation for binary data.
What do I do if my binary length is not divisible by 4?
Add leading zeros to the leftmost group until the total length is a multiple of 4. For example: 101 (3 bits) → 0101 (4 bits), which converts to hex 5. 10111 (5 bits) → 0001 0111 (8 bits), which converts to hex 17. Adding leading zeros does not change the value — 0101 and 101 represent the same number (5). This is the standard convention in all binary-to-hex conversion.
Are spaces required between bits?
No. Spaces are optional and for readability only. The converter accepts continuous binary (10101100) and space-separated binary (1010 1100) — both represent the same value and convert to the same hex result (AC). Spaces between nibble groups (every 4 bits) are a common convention for readability when working with binary manually, but they carry no mathematical meaning.
Can I convert binary to hex manually without a calculator?
Yes. The process is straightforward: group the binary into 4-bit nibbles from right to left, then replace each nibble with its hex equivalent using the 16-entry lookup table (0000=0, 0001=1, ... 1010=A, 1011=B, 1100=C, 1101=D, 1110=E, 1111=F). For example, 1111 0000 1010 1011 converts to F, 0, A, B → F0AB. With practice, the 16 nibble values become memorised and manual conversion becomes fast.
What is the difference between binary, hex, and decimal?
Binary (base-2) uses two digits: 0 and 1. Every value is represented as a power of 2. Decimal (base-10) uses ten digits: 0–9. Every value is a power of 10 — the everyday number system. Hexadecimal (base-16) uses sixteen symbols: 0–9 and A–F. Every value is a power of 16. The same number has different representations in each base: the value 'ten' is 1010 in binary, 10 in decimal, and A in hex. Binary is how computers store data; decimal is how humans count; hex is the programmer's bridge between the two.
Is the Binary to Hex Converter free?
Yes. The converter is free within the usage limits. Guest users can convert up to 200 words of binary per conversion and run 25 conversions per day. Registering a free ToolsPiNG account increases the word limit to 1,000 words per conversion and the daily limit to 100 conversions.