About the Hex to Binary Converter
Checking which bits are set in a flag value, register or network mask means expanding hexadecimal into binary. This hex to binary converter turns each hex digit into its four bits and joins them, working exactly on numbers of any length: 3F becomes 0011 1111. Each digit's bits are shown separately, which makes the conversion easy to follow and check.
No arithmetic on the whole number is needed: because 16 = 2^4, each hex digit corresponds to exactly four bits, so the converter replaces each hex digit with its four-bit pattern and joins them. The groups are shown in the working section. Examples: A in hexadecimal is 1010 in binary; 3FA in hexadecimal is 1111111010 in binary; DEAD in hexadecimal is 1101111010101101 in binary.
Turning hex into binary shows exactly which bits are set, which is what you need when reading hardware registers, flags in file formats, permission masks or network headers. Datasheets and debuggers usually print values in hex, but the meaning of each individual bit only becomes clear when you see the binary pattern, for example that 0x3FA has bit 0 and bit 2 cleared.
Other bases are covered by the number base converter, which converts between any bases from 2 to 36. For arithmetic in these bases, use the binary calculator or the hex calculator; to turn text into its binary character codes, use text to binary.
How to use the Hex to Binary Converter
- Enter the hexadecimal numberType or paste the number. Digits 0 to 9 and A to F, in either case. A 0x prefix is fine.
- Read the binary resultThe binary value appears instantly, along with the octal and decimal equivalents.
- Follow the workingOpen the step-by-step section to see how the conversion was done, digit by digit or division by division.
- Copy or shareCopy all results with one click, or copy a link that reopens the converter with the same number.
Hex to Binary Converter features
- Exact conversion of numbers of any length using BigInt arithmetic
- Step-by-step working for homework and exam practice
- Octal and Decimal results shown alongside
- Negative numbers with 8- to 128-bit two's complement forms
- Optional digit grouping (4 bits, 2 hex digits or thousands) for easy reading
- Accepts prefixes such as 0x, 0b and 0o and ignores spaces and underscores
- Runs in your browser with nothing sent to a server
Common uses
- Checking computer science and digital electronics homework
- Reading values from datasheets, debuggers and log files
- Working out color codes, permissions and bit masks
- Converting values for programming and scripting
- Learning how positional number systems work
Hex to binary in practice: reading status flags, bit numbering conventions, masks, UTF-8 bytes and permission values
Expanding hex into binary reveals what each individual bit is doing, which is what matters when reading flags, masks and encodings. This guide reads a status value bit by bit, explains the two conflicting conventions for numbering bits, expands a network mask, shows how a Urdu letter is packed into UTF-8 bytes and connects a hex value to a familiar file permission.
A worked example: reading status flags
A device reports status 0x2C. Expanding each digit gives 2 as 0010 and C as 1100, so the byte is 0010 1100. Numbering bits from 0 at the right, bits 2, 3 and 5 are set. If the documentation says bit 2 means low battery, bit 3 means charging and bit 5 means connected, the device is charging, connected and still low on battery.
Two ways of numbering bits
Most programming documentation numbers bits from 0 at the least significant, right-hand end. Many networking standards draw packet layouts with bit 0 at the most significant, left-hand end. Reading a diagram with the wrong convention flips the meaning of every flag, so check which convention a document uses before interpreting values.
Masks
The network mask 0xFFFFFFC0 expands to twenty-six ones followed by six zeros, which is 255.255.255.192, a /26 network. Masks written in hex appear in configuration files and firewall rules, and expanding them makes the number of network and host bits obvious at a glance.
How UTF-8 packs a Urdu letter
The letter ی is code point U+06CC, which in binary is 110 1100 1100, eleven significant bits. UTF-8 splits these into two bytes using the patterns 110xxxxx and 10xxxxxx, giving 11011011 10001100, or DB 8C in hex. Working through this by hand shows exactly how UTF-8 marks the start and continuation of multi-byte characters.
From hex to permissions
The hex value 1ED expands to 1 1110 1101, or regrouped in threes from the right, 111 101 101. Those three groups are the octal digits 7, 5 and 5, the familiar permission 755, meaning read, write and execute for the owner and read and execute for everyone else. Binary is the bridge between hex and octal.
Exam technique
Write the four-bit pattern for each hex digit in turn, keeping all four bits for every digit except optionally the first. For 3FA, that gives 0011 1111 1010, and dropping the leading zeros leaves 1111111010. Checking the number of bits, four per digit, catches missing or extra digits.
Toggling and testing bits
In code, testing whether a bit is set uses a mask with a single one in that position, combined with the value using AND. Expanding both the value and the mask to binary on paper makes it obvious why the result is zero or non-zero, which helps when writing or debugging such checks.
Reading hardware documentation
Datasheets list register values in hex with tables describing each bit. Expanding a value and writing the bit numbers above it, from 7 down to 0 for a byte, turns those tables into something you can apply directly. Keep the expanded form in your notes beside the original hex value.
Long values
For 32-bit and 64-bit values, expanding the whole number at once produces long strings that are easy to misread. Expand one byte at a time, separating bytes with spaces, and convert only the bytes you need to inspect. This keeps the work manageable and reduces copying errors.
Common mistakes
- Using the wrong bit-numbering convention for a document.
- Dropping zeros inside the four-bit groups.
- Forgetting that UTF-8 adds marker bits to each byte.
- Reading masks without expanding them.
Related tools
To compress bits back into hex, use Binary to Hex Converter. For arithmetic in hex, try Hex Calculator, and to read permission values, Chmod Calculator.
Windows error codes
Windows reports many errors as 32-bit codes in hex. Expanding the first digits shows their structure: in 0x80070005, the top bit is 1, marking a failure, and the next part identifies the area of Windows that produced the error. The final digits hold the specific error number, here 5, access denied.
Calculators with bit views
The Windows Calculator's Programmer mode shows a value in hex, decimal, octal and binary at once, with a clickable panel of bits. It is a handy companion to this tool when experimenting with flags and masks, since toggling a bit updates every representation immediately.
Byte order first
Values read from files and network packets may be stored with the least significant byte first. Before expanding a multi-byte value to binary to read its flags, put the bytes in the order the documentation describes, otherwise the bits you examine belong to the wrong positions.
Practising with real values
Good practice material is everywhere: colour codes in a stylesheet, MAC addresses on a router's status page and error codes from software. Expanding a few each day, and checking with the converter, builds speed for exams and makes reading hex in real documentation feel natural rather than laborious.
Privacy
Conversions run in your browser. Nothing you enter is sent anywhere or stored.
Frequently asked questions
What is A in binary?
The hex digit A is 10 in decimal and 1010 in binary. Every hex digit maps to four bits: 8 is 1000, 9 is 1001, A is 1010, B is 1011, C is 1100, D is 1101, E is 1110 and F is 1111.
What is the largest number this converter can handle?
It accepts up to 400 digits, far beyond the 64-bit limit of 18446744073709551615 (2^64 − 1). The calculation uses arbitrary-precision integers, so even very long numbers convert exactly without rounding.
Can I convert negative numbers?
Yes. Put a minus sign in front and the result keeps the sign, for example -A in hexadecimal is -1010 in binary. For binary work, the details section also shows the two's complement form that computers use to store negative integers.
Does it convert fractions or decimal points?
No. The converter works with whole numbers, which is what bases are used for in computing. Fractional values such as 0.1 often have infinitely repeating forms in binary, so they need a separate floating-point tool.
Why are the digits grouped?
Grouping makes long numbers easier to read and check: binary is split into blocks of 4 bits (one hex digit each), hex into pairs (one byte each) and decimal into thousands. Untick the grouping option to get one continuous string for copying into code.
Are hex letters case-sensitive?
No. The letters A to F and a to f mean the same values, 10 to 15, so 1f4, 1F4 and 0x1F4 are all read as 500. The converter accepts either case and always shows hex results in capitals, which is the most common convention in documentation.