CalcBoard / All Free Calculators / Hex & Binary Converter

Hex, Decimal, Octal & Binary Converter

All four bases at once — type in any of them — plus the bitwise operations, with results shown in hex and binary too.

Download CalcBoard Free

Base Converter

Type in any field — the other three update as you go, the way CalcBoard’s programmer mode shows all four bases at once.

DEC
HEX
OCT
BIN

Bitwise

8

Bitwise results are 32-bit and signed, because that is what JavaScript operators do: ~12 is −13, and values past 231 wrap. Base conversion above is limited to 253. CalcBoard’s programmer mode uses arbitrary-size integers and has neither ceiling.

Reference table

Decimal, hexadecimal, octal and binary equivalents
DecimalHexOctalBinary
88101000
10A121010
15F171111
1610201 0000
6440100100 0000
1277F177111 1111
128802001000 0000
255FF3771111 1111
10244002000100 0000 0000
65535FFFF1777771111 1111 1111 1111

Converting by hand

Hex to decimal

Each hex digit is a power of 16, counting from the right. 2F is 2×16 + 15 = 47. 1A3 is 1×256 + 10×16 + 3 = 419. The letters A–F stand for 10–15.

Hex to binary

This one is mechanical, and it is why hex exists: each hex digit is exactly four binary digits. F is 1111, A is 1010, so FA is 1111 1010. No arithmetic required — just substitute. That four-bit group is a nibble, and it is why the binary field above is grouped in fours.

Decimal to binary

Halve repeatedly and record the remainders, then read them bottom to top. 13 → 6 r1, 3 r0, 1 r1, 0 r1 → 1101.

The bitwise operations

Bitwise operations with examples
OperationDoesExample
AND (&)1 only where both bits are 112 & 10 = 8
OR (|)1 where either bit is 112 | 10 = 14
XOR (^)1 where the bits differ12 ^ 10 = 6
NOT (~)flips every bit~12 = −13
Left shift (<<)multiplies by 2 per place3 << 4 = 48
Right shift (>>)divides by 2 per place, discarding remainder48 >> 4 = 3

Masking is the everyday use: value & 0xFF keeps the low byte, value | 0x80 sets the top bit of a byte, and (rgb >> 16) & 0xFF pulls the red channel out of a packed colour.

Where this tool stops

Two real limits, both of which the app does not have. JavaScript's bitwise operators are 32-bit and signed, so ~12 shows as −13 and anything past 231 wraps. And whole numbers above 253 cannot be represented exactly in a browser at all.

CalcBoard's programmer mode keeps all four bases on screen permanently rather than in a converter box, has hex A–F keys on the keypad, and falls back to arbitrary-size integers instead of overflowing. It is part of the one-time $2.99 Premium unlock.

Frequently Asked Questions

How do I convert hex to decimal?
Multiply each digit by its power of 16 and add. 2F is 2×16 + 15 = 47. A–F represent 10–15. The converter above does it as you type, in both directions.
Why is hexadecimal used in programming?
Because one hex digit maps exactly onto four binary digits, so hex is a compact, lossless shorthand for binary. FF is 1111 1111 — one byte in two characters — with no arithmetic needed to translate.
What is 0xFF in decimal?
255. It is the largest value that fits in one 8-bit byte, which is why it turns up constantly as a mask and as the maximum for a colour channel.
What does the AND operator do?
It compares two numbers bit by bit and returns 1 only where both bits are 1. 12 (1100) AND 10 (1010) = 8 (1000). It is most often used to mask out the bits you do not want.
Does this handle 64-bit values?
Not reliably — browser bitwise operations are 32-bit and signed. CalcBoard's programmer mode falls back to arbitrary-size integers, so large values stay exact.

Four bases, always on screen

Programmer mode shows BIN, OCT, DEC and HEX at once, offline, with no 32-bit ceiling.

Download Free on App Store