Convert Hex to Binary in One Step
Paste or type any hexadecimal value above and this tool instantly shows the binary equivalent — no sign-up, no wait, no guesswork. It also displays the decimal and octal equivalents at the same time, so you get the full picture in one look.
Every conversion runs entirely in your browser. Nothing you type is sent to a server, so sensitive values like firmware bytes, memory addresses, or colour codes stay completely private.
How to Use the Hex to Binary Converter
- Type or paste your hex value into the input field above (e.g.
1For0xFF— the0xprefix is optional). - The tool converts it instantly as you type. No button to press.
- Click the copy icon next to any output field to copy that result to your clipboard.
- Need to go the other way? Switch the direction to binary to hex with one click.
Worked Example: Hex to Binary
Let's convert 0xA5 (a common byte value you'll see in CRC checks and network masks) to binary.
Split the hex number digit by digit. Each hex digit maps to exactly 4 binary bits:
| Hex digit | Binary (4 bits) |
|---|---|
| A | 1010 |
| 5 | 0101 |
Concatenate the two groups: A5 → 1010 0101
So 0xA5 in binary is 10100101. The tool also tells you this equals 165 in decimal and 245 in octal — all at once.
Step-by-Step Bit Breakdown of 0xA5
If you want to verify by hand, here's how each bit contributes to the final decimal value:
Bit position: 7 6 5 4 3 2 1 0
Bit value: 1 0 1 0 0 1 0 1
Place value: 128 64 32 16 8 4 2 1
128 + 32 + 4 + 1 = 165 ✓Quick Hex → Binary Reference Table
| Hex | Binary | Decimal |
|---|---|---|
| 0 | 0000 | 0 |
| 1 | 0001 | 1 |
| 4 | 0100 | 4 |
| 8 | 1000 | 8 |
| A | 1010 | 10 |
| F | 1111 | 15 |
| 1F | 0001 1111 | 31 |
| FF | 1111 1111 | 255 |
| A5 | 1010 0101 | 165 |
How to Convert Hex to Binary in Code
When you need this inside a script rather than a one-off lookup, here are the shortest correct ways to do it.
Python
# Python 3
hex_value = 'A5'
binary_string = bin(int(hex_value, 16))[2:] # '10100101'
print(binary_string)
# With zero-padding to a full byte (8 bits):
padded = format(int(hex_value, 16), '08b') # '10100101'
print(padded)JavaScript
// Browser or Node.js
const hexValue = 'A5';
const binaryString = parseInt(hexValue, 16).toString(2); // '10100101'
console.log(binaryString);
// Zero-pad to 8 bits:
const padded = parseInt(hexValue, 16).toString(2).padStart(8, '0');
console.log(padded); // '10100101'Both snippets are copy-pasteable and handle any uppercase or lowercase hex input. The [2:] in Python strips the 0b prefix that bin() adds automatically.
How the Converter Works
Hexadecimal uses base 16 (digits 0–9 and letters A–F). Binary uses base 2 (only 0 and 1). The converter translates by treating each hex digit as a 4-bit group — because 16 = 2⁴, the mapping is always exact with no rounding.
For multi-byte inputs like FF2A, the tool processes each nibble (a nibble is a 4-bit group, half a byte) in order and joins them. The result, 1111111100101010, can then be read bit-by-bit for hardware registers, colour channels, or bitmask logic.
The underlying algorithm follows the positional notation standard described by NIST positional numeral conventions — the same rules used in every programming language and CPU instruction set.
When to Use Hex-to-Binary Conversion
- Embedded systems & firmware — reading register values like
0x3Fto check which individual bits are set. - Network engineering — inspecting subnet masks or packet headers byte by byte.
- Colour codes — breaking
#FF5733into its red, green, and blue bit patterns. - Bitwise operations — before writing bitmask code in C, Rust, or Python, seeing the exact binary layout first.
- Debugging memory dumps — hex dumps from debuggers become readable bit patterns.
When NOT to Use This Tool
- Very large binary files or data streams — this converter handles individual values, not streaming byte arrays. For bulk file conversion, use a command-line tool like
xxdorhexdump. - Floating-point numbers — values like
3.14require IEEE 754 encoding logic, which this base converter does not model. Use a dedicated float-to-bits tool for that. - Signed / two's-complement negatives — the tool converts the raw bits; interpreting them as negative numbers depends on word size (8-bit, 16-bit, 32-bit), which you'll need to account for separately.
Need to work with structured data formats rather than raw numbers? Our JSON Beautifier and JSON Validator are a click away for those workflows.
Ready to convert? Drop your hex value into the field above and get the binary result instantly.