Binary converter
Convert text to binary and back.

Binary converter is a free tool that converts an entered base-2 value through decimal form into hexadecimal numeric notation.
Why can four binary digits become one hex digit?
Four binary digits can become one hexadecimal digit because both groups represent 16 possible values. Binary uses only 0 and 1, while hexadecimal uses 0 through 9 and a through f. Grouping binary digits in sets of four makes long values easier to read.
For one worked example, binary 101101 can be grouped as 0010 1101. The first group is hexadecimal 2, and the second is hexadecimal d, so 101101 in binary equals 45 in decimal and 2d in hexadecimal.

A compact value map
| Binary | Decimal | Hexadecimal |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 1 | 1 |
| 101 | 5 | 5 |
| 1010 | 10 | a |
| 1111 | 15 | f |
| 10000 | 16 | 10 |
Hexadecimal letters are case-insensitive, so a and A represent the same value. The underlying dechex function produces lowercase letters.

What should you enter in the conversion fields?
Enter a base-2 numeral in the applicable field labeled To binary or To text. The returned field labeled Binary contains the hexadecimal result. The implementation uses bindec and dechex, which perform numeric conversion rather than general character encoding.
- A binary numeral should contain only 0 and 1.
- Leading zeros do not change its numeric value, although they may show a fixed bit width.
- Spaces used to group bits are not binary digits and should be removed before numeric conversion.
- Punctuation, accented letters, emoji, and non-Latin characters are not valid parts of a binary numeral.
This numeric operation is not a general-purpose way to convert arbitrary Unicode text into bytes. Use an ASCII converter when the source consists of ASCII characters and you need character codes. Very long binary values may also exceed the exact integer range available to the server-side numeric functions, so do not assume that an unusually large input will remain exact.
The work takes place on the server. Input travels to the server over HTTPS and is not stored.

Where do base-2 values appear in real work?
Base-2 values appear wherever individual bits represent quantities, states, or flags. Hexadecimal is often used beside binary because it expresses the same bit pattern more compactly.
- Programming: inspecting bitmasks, permissions, status flags, and register values.
- Networking: checking subnet masks, address bits, packet fields, and protocol flags.
- Electronics: reading logic-analyzer output, GPIO states, and microcontroller registers.
- Education: practicing place values and conversion among binary, decimal, and hexadecimal.
- Radio: examining encoded protocol fields, control flags, and values reported by radio hardware.
A Hex converter can help when you need to move between compact hexadecimal notation and another number base.
Avoiding a common hand-conversion error
Count binary positions from the right, starting with a value of 1. A common mistake is to count from the left as though the first visible digit always had the same place value. Its value actually depends on the total number of positions.
When checking work, group digits from the right in sets of four. Add zeros only to the left if the first group is short. Adding or removing a zero on the right changes the value, while adding a zero on the left does not.
Common questions about binary notation
Can I include a 0b prefix?
The 0b prefix commonly marks a binary literal in programming languages, but the prefix itself is not part of the numeral. For strict numeric conversion, remove 0b and enter only the following zeros and ones.
Is a byte always shown as eight binary digits?
A byte is commonly eight bits in modern computing, but a binary numeral does not need to be eight digits long. Pad a value with leading zeros when a file format, register diagram, or protocol specification requires an eight-bit display.
How are negative binary values interpreted?
A minus sign can describe a negative mathematical value, while computer systems commonly store signed integers using two's complement. Interpreting a two's-complement pattern requires a defined width, such as 8, 16, or 32 bits. Without that width, the sign cannot be determined from the bit pattern alone.
Should I keep separators when copying bits from documentation?
The Binary converter accepts unseparated binary numerals containing only 0 and 1, so remove spaces, underscores, commas, and other visual separators. Keep a separate copy of the grouped version if you need to compare fields or bit boundaries after conversion.
Similar tools
Popular tools
Create a WhatsApp chat link from a phone number, with an optional prefilled message.