Tools

Home
Percentage CalcUnit ConverterBMI CalculatorCalculatorTip Calculator

Binary Converter

Convert between Binary, Decimal, Octal, and Hexadecimal with live conversion and bitwise operations

Your files never leave your browser
Decimal (Base 10)
Waiting for input...
Binary (Base 2)
Waiting for input...
Octal (Base 8)
Waiting for input...
Hexadecimal (Base 16)
Waiting for input...

Bitwise Operations

Result
DEC-
BIN-
OCT-
HEX-
Ready·Enter a number to convert

Drop a hex value, binary string, or plain decimal into the input field and get every base conversion at once — decimal, binary, octal, and hex. It also handles bitwise operations like AND, OR, XOR, and bit shifts, so you can test masks or check permission flags without switching to a terminal. And everything runs in your browser. Nothing gets uploaded.

How It Works

Enter Number
→
Detect Base & Parse
→
Show All Bases

Type a number and pick its format — or let auto-detect figure it out from prefixes like 0b, 0x, or 0o. The tool parses your input into an integer, then converts it to binary, decimal, octal, and hex simultaneously. Binary output gets grouped into 4-bit nibbles so it's actually readable.

Examples

IP Subnet Mask Check

You need to verify which bits are set in a /24 subnet mask.

INPUT
255 (Decimal)
OUTPUT
BIN: 1111 1111 OCT: 377 HEX: FF

Reading a Color Code in Binary

You want to see what hex color #3A looks like at the bit level — maybe for a shader or hardware register.

INPUT
0x3A (Hex)
OUTPUT
DEC: 58 BIN: 0011 1010 OCT: 72

Bitwise AND for Permission Flags

Unix file permissions: you've got 755 in octal and want to check if the execute bit (1) is set for "others" using AND.

INPUT
A: 493 (decimal for 0o755) B: 1 Op: AND
OUTPUT
DEC: 1 BIN: 0000 0001 (Execute bit is set)

Who Uses This

👨‍💻 Developers

Debugging bit flags, reading memory dumps, and testing bitwise logic before writing code.

🌐 Network Engineers

Converting subnet masks and IP addresses between decimal, binary, and hex.

🎓 CS Students

Checking homework answers for base conversion and two’s complement exercises.

🔧 Embedded Engineers

Reading hardware register values and toggling specific control bits.

Common Mistakes

Forgetting the 0x or 0b prefix

You type “FF” expecting hex, but the tool reads it as decimal (or errors out). Either add 0x before it or pick Hexadecimal from the dropdown.

Mixing up octal and decimal

The number 10 in octal is 8 in decimal. If you're pasting Unix permission values (like 755), make sure the input format is set to Octal — otherwise you'll get a completely wrong binary output.

Expecting more than 32-bit results from bitwise ops

JavaScript’s bitwise operators work on 32-bit signed integers. If you AND two large numbers, the result wraps to 32 bits. The regular converter handles bigger numbers — bitwise is the one with the 32-bit limit.

Technical Details

Frequently Asked Questions

How do I convert binary to decimal?

Each binary digit represents a power of 2, starting from the right. So 1101 in binary is (1×8) + (1×4) + (0×2) + (1×1) = 13 in decimal. Or just paste the binary number here, pick “Binary” as the input, and the decimal shows up instantly.

What is two’s complement?

Two’s complement is how computers store negative numbers. You flip all the bits and add 1. For example, -5 in 8-bit two’s complement is 11111011. This converter shows the 32-bit two’s complement for any negative number you enter.

What is the difference between binary and hexadecimal?

Binary uses 2 digits (0, 1) and hex uses 16 (0-9 plus A-F). Hex is really just a shorthand for binary — each hex digit maps to exactly 4 binary digits. That’s why programmers prefer hex for things like memory addresses. It is way shorter than writing out all those ones and zeros.

Can I convert negative numbers to binary?

Yes. Enter a negative decimal like -42 and the tool shows its 32-bit two’s complement binary representation (11111111111111111111111111010110). This matches how C, Java, and most programming languages store negative integers internally.

How do bitwise operations work?

Bitwise operations compare or modify numbers at the individual bit level. AND gives 1 only when both bits are 1. OR gives 1 when either bit is 1. XOR gives 1 when the bits differ. NOT flips every bit. Shifts move all bits left or right, which is the same as multiplying or dividing by 2.

Share: