Summary: convert binary to hex, free and private
To convert binary to hex for free and without uploading anything, type or paste the binary number into Binary Input, for example 11010110. Hexadecimal Output shows 0xD6 straight away. Put each number on its own line, or separate them with commas, to convert several at once. The conversion runs in your browser, and the Network tab in your browser's DevTools shows that nothing is sent.
Binary to hex conversion rewrites a base-2 number in base 16. Each hex digit stands for exactly four bits, so group the bits in fours from the right and replace each group with its digit. A number with n bits needs ceil(n รท 4) hex digits. This tool treats the input as a number, not text; to read bits as letters, use the binary to text converter, and for hex on its own page see the hex to binary converter.
Table of Use: what to enter and what you get
| You enter | Setting | Result |
|---|---|---|
1010 | Binary โ Hex, defaults | 0xA |
11010110 | Binary โ Hex, defaults | 0xD6 |
00001111 | Binary โ Hex, defaults | 0x0F (leading zeros kept) |
101 | Binary โ Hex, defaults | 0x5 (padded to 0101) |
1010 1100 | Binary โ Hex, defaults | 0xAC (one number, spaces group digits) |
01001000 01101001 | Single spaces separate numbers | 0x48 and 0x69 on two lines |
0x1A3 | Hex โ Binary | 0b000110100011 |
#ff00ff | Hex โ Binary | 0b111111110000000011111111 |
1012 | Binary โ Hex | ? plus a message that "2" is not a binary digit |
Every four-bit group maps to one hex digit:
| Binary | Hex | Binary | Hex |
|---|---|---|---|
0000 | 0 | 1000 | 8 |
0001 | 1 | 1001 | 9 |
0010 | 2 | 1010 | A |
0011 | 3 | 1011 | B |
0100 | 4 | 1100 | C |
0101 | 5 | 1101 | D |
0110 | 6 | 1110 | E |
0111 | 7 | 1111 | F |
Features
- Both directions. Binary โ Hex and Hex โ Binary buttons, plus Swap to send the result back as input.
- Any length, exact. Bits are converted four at a time rather than through JavaScript numbers, so long numbers do not lose precision.
- Many numbers at once. New lines, commas, semicolons, tabs and runs of two or more spaces separate numbers; a counter shows how many were read.
- Forgiving input. Spaces and underscores inside a number are ignored, and
0bis accepted; hex input may start with0xor#. - Output options. Add the 0x prefix (0b when going to binary) and choose uppercase or lowercase AโF for hex output.
- Clear errors. A bad number shows as ? on its own line so the rest stay aligned, and the first five problems are listed.
- Examples, copy and download. Three Quick Examples, Copy, Download (
binary-to-hex-conversion.txtorhex-to-binary-conversion.txt) and Clear.
See also the octal to decimal converter, the decimal to octal converter and the ASCII to text converter, which reads decimal or hex byte values as characters.
How to Use the Binary to Hex Converter
- Make sure "Binary โ Hex" is selected at the top.
- Type or paste binary numbers into "Binary Input", or click Example: 1010, Batch Example or With Spaces.
- Put each number on its own line, or separate them with commas.
- Tick or untick Add "0x" prefix and Uppercase output (AโF) to suit your style.
- Read the result in "Hexadecimal Output" and check below it for any โ ๏ธ message about a number that could not be converted.
- Click Copy or Download, press Swap to convert the result back, or click Clear to start again.
Who Can Use It
Students check homework conversions and see the nibble pattern. Firmware developers turn register values into hex, and security learners move between bits and hex in byte dumps and hash digests such as the output of the SHA-256 hash generator.
Web designers can paste #ff00ff into Hex โ Binary to see its three bytes as bits, then compare it in the colour code converter. Developers can go on to the text to ASCII converter or the Base64 encoder.
FAQs
How do I convert binary to hex?
Type or paste the binary number into Binary Input and the hexadecimal value appears in Hexadecimal Output as you type: 11010110 becomes 0xD6. For several numbers, put each on its own line or separate them with commas. Untick Add "0x" prefix or Uppercase output (AโF) to match the style you need. Nothing is uploaded.
How do I convert binary to hex by hand?
Split the bits into groups of four from the right, adding zeros on the left if the first group is short, then replace each group with its hex digit. For 11010110, the groups 1101 and 0110 are D and 6, so the answer is D6. The sixteen groups run from 0000 = 0 to 1111 = F.
Can I convert binary numbers that contain spaces?
Yes. By default a single space or underscore is digit grouping, so "1010 1100" and "10101100" both give 0xAC. Two or more spaces, a tab, a comma, a semicolon or a new line start a new number. If single spaces separate your numbers, such as the bytes "01001000 01101001", tick "Single spaces separate numbers".
How do I convert hex back to binary?
Click "Hex โ Binary", or press Swap after a conversion to send the output back as input in the opposite direction. Each hex digit becomes exactly four bits, so leading zeros are kept: 0x1A3 gives 0b000110100011. A 0x or # prefix, spaces and underscores in the hex are accepted.
Does it handle negative, fractional or very long binary numbers?
It converts unsigned whole numbers. A minus sign or a binary point is reported as an invalid character, and the number shows as ? while the others still convert. Length does not matter: bits are converted in groups of four rather than as JavaScript numbers, so a million-bit number converts exactly.
Is it safe to paste my binary data into this converter?
Yes. The conversion runs as JavaScript in your browser and nothing is uploaded or stored; open the Network tab in your browser's DevTools and you will see no request when you type or paste. There is no account or sign-up, and reloading the page clears the input.