Hex to Binary Converter – Free, Instant & Online

Convert hex to binary instantly in your browser. Paste any hexadecimal value and see binary, decimal, and octal at once. Free, no sign-up, data stays

Binary

11111111

In every base

Binary11111111
Octal377
Decimal255
HexFF

Converts instantly in your browser — arbitrarily large numbers supported. Prefixes 0b / 0o / 0x and spaces are accepted.

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

  1. Type or paste your hex value into the input field above (e.g. 1F or 0xFF — the 0x prefix is optional).
  2. The tool converts it instantly as you type. No button to press.
  3. Click the copy icon next to any output field to copy that result to your clipboard.
  4. 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 digitBinary (4 bits)
A1010
50101

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

HexBinaryDecimal
000000
100011
401004
810008
A101010
F111115
1F0001 111131
FF1111 1111255
A51010 0101165

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 0x3F to check which individual bits are set.
  • Network engineering — inspecting subnet masks or packet headers byte by byte.
  • Colour codes — breaking #FF5733 into 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 xxd or hexdump.
  • Floating-point numbers — values like 3.14 require 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.

Frequently asked questions

Is my hex data uploaded to a server?+
No. Every conversion happens entirely inside your browser using JavaScript. Nothing you type leaves your device, which makes it safe to use with sensitive values like API keys encoded in hex, firmware bytes, or internal memory addresses.
Does it cost anything or require an account?+
It's completely free and requires no sign-up. Just open the page and start converting.
Can I convert binary back to hex?+
Yes — the tool is bidirectional. Switch the input and output fields to go from binary to hexadecimal. You can also convert between hex, decimal, and octal on the same page.
How do I convert hex to binary in Python?+
Use bin(int('A5', 16))[2:]. This converts the hex string to an integer, then to a binary string, then strips the leading 0b prefix. Add .zfill(8) or format(..., '08b') if you need zero-padding to a fixed number of bits.
How do I convert hex to binary in JavaScript?+
Use parseInt('A5', 16).toString(2). That gives you the binary string without any prefix. Chain .padStart(8, '0') on the end to pad it to a full byte if needed.
What is a nibble and why does it matter here?+
A nibble is 4 bits — exactly half a byte. Each hex digit always maps to one nibble, which is why converting hex to binary is so clean: no rounding, no loss of information. F is always 1111, no matter the context.
Can this handle large hex numbers like 64-bit addresses?+
Yes. The tool uses JavaScript's BigInt internally, so it handles hex values well beyond 32 bits — including 64-bit memory addresses and long hash fragments — without overflow or precision loss.
What's the difference between hexadecimal and binary?+
Binary (base 2) only uses 0 and 1 — one digit per bit. Hexadecimal (base 16) uses 0–9 and A–F, compressing four binary digits into one hex digit. Hex is compact and human-readable; binary shows the exact bit-level detail CPUs and hardware registers work with.