Free Hex to Binary Converter

This hex to binary converter turns a hexadecimal value such as 0xFF or #FF5733 into its binary form, with every hex digit written as four bits. Switch to Binary โ†’ Hex to go the other way. Input is checked as you type, lists convert one value per line, and everything runs in your browser - nothing is uploaded.

0 characters

Tip: each line is converted separately. Commas, semicolons or a new 0x / # prefix separate values on a line; spaces, colons and underscores inside a value are ignored. Ctrl+Enter (Cmd+Enter on a Mac) converts.

0 characters

Actions:

Quick Examples:

Hex to Binary:
  • FF โ†’ 1111 1111
  • 1A โ†’ 0001 1010
  • CAFE โ†’ 1100 1010 1111 1110
Binary to Hex:
  • 11111111 โ†’ 0xFF
  • 00011010 โ†’ 0x1A
  • 1100101011111110 โ†’ 0xCAFE

Tips:

  • Swap moves the result into the input and converts it back the other way
  • Put one value per line to convert a list in one go; values separated by commas on one line are converted separately too (0x1, 0xFF โ†’ 0001, 1111 1111)
  • Hex input is case-insensitive (FF = ff = Ff); hex output is upper case
  • Choose 8-bit grouping to see whole bytes, e.g. #FF5733 โ†’ 11111111 01010111 00110011 (an odd number of hex digits is padded to a full byte: ABC โ†’ 00001010 10111100)
  • Leading zero digits are kept: 0x0F converts to 0000 1111, and 0000 0001 to 0x01
  • Undo and Redo step through your conversions, restoring both boxes with the current output options
  • Everything runs in your browser - nothing you type is uploaded

Hex to binary converter: convert hexadecimal to binary, free and private

A hex to binary converter rewrites a hexadecimal number as the bits it stands for. To convert hexadecimal to binary free and privately, type or paste a value such as 0x1A or #FF5733 into Hexadecimal Input, keep Hex โ†’ Binary selected and click Convert to Binary. Each hex digit becomes exactly four bits, so 1A becomes 0001 1010. The conversion runs in your browser; nothing is uploaded, and you can confirm that in the Network tab of DevTools.

The method is a lookup, not arithmetic. Because 16 is 2 to the power 4, one hex digit always equals four bits (a nibble), so you can convert by hand with the table below. Going back, split the bits into groups of four from the right, pad the leftmost group with zeros and swap each group for its hex digit: 1101 0110 is D6. Click Binary โ†’ Hex for that direction, or open the dedicated binary to hex converter.

Hex to binary table: each hexadecimal digit with its 4-bit binary value
Hex digitBinaryHex digitBinary
0000081000
1000191001
20010A1010
30011B1011
40100C1100
50101D1101
60110E1110
70111F1111

Hex only changes how bits are written, never the value: 0xFF and 1111 1111 are the same number. For base 8 and base 10 use the octal to decimal converter and the decimal to octal converter.

Table of Use: hex and binary inputs with their results

Example inputs, the direction and option used, and the result the converter gives
You enterDirection and optionYou get
FFHex โ†’ Binary, 4 bits (nibbles)1111 1111
0x1AHex โ†’ Binary, 4 bits. The 0x prefix is dropped, the leading zero kept0001 1010
#FF5733Hex โ†’ Binary, 8 bits (bytes). A CSS color: red, green and blue bytes11111111 01010111 00110011
AA:BB:CCHex โ†’ Binary, 8 bits. Colon-separated bytes, as in a MAC address10101010 10111011 11001100
ABCHex โ†’ Binary, 8 bits. An odd digit count is padded to whole bytes00001010 10111100
11111111Binary โ†’ Hex. Untick Add 0x prefix to get FF instead0xFF
101Binary โ†’ Hex. The leftmost group is padded to 01010x5
0b101 0b11Binary โ†’ Hex. Each 0b prefix starts a new value0x5, 0x3

Color codes are a common reason to paste hex here. To turn #RRGGBB into RGB, HSL or CMYK instead, use the color code converter, or choose a shade visually with the color picker.

Features

  • Both directions. Hex โ†’ Binary and Binary โ†’ Hex buttons switch the tool. Hex input is case-insensitive; hex output is upper case.
  • Prefixes accepted. Hex may start with 0x or #, binary with 0b. Spaces, tabs, colons and underscores inside a value are ignored, so AA:BB:CC and 1101_0110 are single values.
  • Lists of values. Each line is converted separately and blank lines are kept. Commas, semicolons or a new prefix split values on one line.
  • Group binary output. 4 bits (nibbles), 8 bits (bytes, padded to whole bytes) or No spaces. Changing it re-formats the result on screen.
  • Add 0x prefix to hex output. A checkbox for Binary โ†’ Hex, ticked by default.
  • No size limit on values. Digits are converted one at a time, so there is no 32-bit or 64-bit ceiling and no rounding.
  • Checked as you type. An invalid character is named in a red message, with its line number for lists.
  • Undo, Redo, Swap, Copy, Download, Clear. Swap moves the result into the input and converts it back. Download saves hex-to-binary.txt or binary-to-hex.txt.
  • Counters and shortcut. The output shows its bit count, and Ctrl+Enter (Cmd+Enter on a Mac) converts.

It converts digits, not meanings: no signed numbers, byte order or text decoding, and a minus sign or decimal point is rejected. To turn bits into letters, use the binary to text converter.

How to convert hex to binary, step by step

  1. Pick the direction. Hex โ†’ Binary is selected when the page opens; click Binary โ†’ Hex to reverse it.
  2. Set the output option. For Hex โ†’ Binary, open Group binary output and choose 4 bits (nibbles), 8 bits (bytes) or No spaces. For Binary โ†’ Hex, tick or untick Add 0x prefix to hex output.
  3. Type or paste your value into Hexadecimal Input (Binary Input in the other direction). Put one value per line to convert a list.
  4. If a red message appears under the box, fix the invalid character it names; the Convert button stays disabled until you do.
  5. Click Convert to Binary (Convert to Hex), or press Ctrl+Enter or Cmd+Enter.
  6. Read the result in Binary Output. The counter above it shows how many bits it contains.
  7. Click Copy, Download or Swap. Undo and Redo step through earlier conversions; Clear empties both boxes.

Who can use it

  • Programmers and students checking bit flags and masks: 0x0F AND 0xAA is easy to follow as 0000 1111 AND 1010 1010.
  • Embedded developers reading register values and datasheet constants.
  • Network engineers inspecting MAC addresses and packet bytes. Percent-encoded URLs use the same two-digit hex bytes, which the URL encoder produces for you.
  • Web developers and designers breaking a color code into its red, green and blue bytes.
  • Security and data people reading digests: a SHA-256 value from the SHA-256 hash generator is 64 hex digits, which is 256 bits, and a UUID from the UUID generator is 32 hex digits, or 128 bits.
  • Learners checking hand conversions, then moving on to the text to ASCII converter and the ASCII to text converter.

FAQs

How do I convert hex to binary?

Replace every hexadecimal digit with its 4-bit binary value: 0 is 0000, 9 is 1001, A is 1010, F is 1111. So 2A becomes 0010 1010. To let the tool do it, paste the hex value into Hexadecimal Input, keep Hex โ†’ Binary selected and click Convert to Binary. Leading zeros are kept, because each digit always gives exactly four bits.

How do I convert binary to hex?

Split the bits into groups of four starting from the right, pad the leftmost group with zeros if it is short, and replace each group with its hex digit. 1101 0110 becomes D6, and 101 becomes 5. In this tool, click Binary โ†’ Hex, paste the bits into Binary Input and click Convert to Hex. Spaces between groups are ignored.

What is the difference between hexadecimal and binary?

Binary is base 2 and uses only the digits 0 and 1; hexadecimal is base 16 and uses 0 to 9 and A to F. Because 16 is 2 to the power 4, each hex digit stands for exactly four bits. Hex is therefore a shorter way to write the same bits: 0xFF and 11111111 are the same value.

How do I convert a hex color code such as #FF5733 to binary?

Paste #FF5733 into Hexadecimal Input (the # is accepted) and choose 8 bits (bytes) under Group binary output. The result is 11111111 01010111 00110011: one byte each for red (FF, 255), green (57, 87) and blue (33, 51). With 4 bits (nibbles) selected you get the same bits in groups of four.

Can I convert several hex values at once, and are leading zeros kept?

Yes to both. Put one value per line and each line is converted separately. Several values can also share a line if you separate them with commas, semicolons or a fresh 0x prefix. Leading zeros survive: 0x0F converts to 0000 1111, and in the other direction 0000 0001 converts to 0x01.

How large a hex value can I convert?

There is no 32-bit or 64-bit limit. The tool converts digit by digit instead of reading the input as one number, so a 200-digit value is converted exactly, with no rounding. The practical limit is how much text your browser can hold in a text box. Negative numbers and fractions are not supported.

Why does the converter say a character is not valid?

Hex input may contain only 0-9 and A-F, and binary input only 0 and 1. The message names the first bad character and, for lists, its line, and Convert to Binary stays disabled until you fix it. Common causes are the letter O typed for zero, a minus sign or decimal point, and a 0x prefix with no digits after it.

Is it safe to paste hex data into this converter?

Yes. The conversion is plain JavaScript running in your browser, so what you paste is never uploaded or stored by ZipConvert. You can check this yourself: open the Network tab in your browser DevTools, convert a value, and no request carrying your input appears.