Hex to Binary Converter
CU-09Paste hexadecimal numbers, one per line, and get binary back. Every hex digit becomes exactly four bits, so a byte always shows all eight.
Runs in your browser. Nothing is uploaded.
Numbers (one per line)
Result
How to use it
- Paste one hex number per line. A 0x prefix, spaces, colons and underscores are accepted.
- Press Hex to binary. Use Binary to hex to go back.
- Choose how to group the binary digits: not at all, in fours or in eights.
- Tick Trim leading zeros if you want the shortest form.
- Copy the result or download it as a .txt file.
Four bits per hex digit
A hex digit stands for a value from 0 to 15, which is four binary digits. F is 1111, A is 1010 and 0 is 0000. The tool swaps each digit for its four bits, so 0F becomes 00001111 and DEADBEEF becomes a 32-digit number. This is the form you want when reading a flag byte, a color value or a memory dump, because the position of every bit stays visible. Grouping in fours or eights puts a space between groups so the bits are easier to count.
Input rules and limits
Hex digits are 0 to 9 and A to F, in either case. A leading 0x, spaces, colons and underscores are ignored, so DE:AD:BE:EF and de ad be ef both work. A leading minus sign is carried over to the result. Only whole numbers are converted, with no fractions, no two's complement and no fixed word size. There is no size limit beyond your browser, and nothing is rounded because the digits are converted one by one.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
"1G" is not a hexadecimal number: "G" is not allowed (use 0-9 and A-F). | The line contains a character outside 0-9 and A-F. | Correct that character, or remove text that is not part of the number. |
Questions people ask
How do I convert hex to binary by hand?
Write each hex digit as four bits: 0 is 0000, 9 is 1001, A is 1010 and F is 1111. Join the groups in order. For example 2F becomes 0010 1111. The tool does this for every line you paste.
What is 0xFF in binary?
FF is 11111111: eight ones, which is the largest value one byte can hold (255 in decimal). Enter FF or 0xFF and press Hex to binary to see it.
How do I group the binary digits?
Use the Binary results: group digits option. Groups of 4 show each hex digit as one nibble, and groups of 8 show each byte. The groups are separated by spaces, and the result is padded on the left to fill the first group.
Does it accept hex with a 0x prefix or spaces?
Yes. A 0x prefix is removed, and spaces, colons and underscores inside the number are ignored, so a MAC-style DE:AD:BE:EF converts as one number. Each line is still one number.
Can I convert hex to binary and back?
Yes. The second button converts binary to hex using the same options. Because both directions work digit for digit, converting to binary and back returns your original digits, apart from letter case and any leading zeros you trimmed.
About this tool
Converts whole hexadecimal numbers to binary, and the second button goes the other way. Each digit is converted on its own (one hex digit is 4 bits, one octal digit is 3 bits), so leading zeros you type are kept: 0F becomes 00001111. Tick "Trim leading zeros" to drop them. Spaces and underscores inside a number are ignored, a leading minus sign is carried over, and a 0x, 0b or 0o prefix is accepted. Only whole numbers are handled; there is no fraction part and no two's complement. Each line is converted on its own, with no size limit other than your browser's.