Live converter

Type into any field — the others stay in sync. Decimal accepts negatives; binary and hex use unsigned (positive) values.

Binarybase 2
digits: 0 / 1
Decimalbase 10
digits: 0–9
Hexadecimalbase 16
digits: 0–9, A–F
Octalbase 8
digits: 0–7

Step-by-step walkthrough

Type a number above to see how each conversion works.
Why these four bases? Binary is how transistors store data (on / off). Decimal matches our 10 fingers. Hexadecimal is binary's compact partner — every hex digit maps to exactly 4 bits, so a byte is two hex characters. Octal groups bits in threes; it's still used for Unix file permissions (`chmod 755`).

Bit toggle

Each bit is a power of 2. Click any bit to flip it. The decimal value is the sum of every place where the bit is 1.

Width:
Decimal
0
Hex
0
Binary
0
Signed (two's compl.)
0
Two's complement is how computers store negative numbers. The leftmost bit (MSB) becomes the sign: 0 = positive, 1 = negative. To negate, flip every bit and add 1. An 8-bit signed value ranges from −128 to +127.

Bitwise operations

Bitwise ops compare binary digits position by position. They're how flags get packed, RGB colors get masked, and graphics shaders run fast.

Adecimal
Bdecimal
Where you'll meet these ops: AND clears bits (mask), OR sets bits, XOR toggles them. Left-shift by 1 multiplies by 2, right-shift divides by 2 (cheaper than mul/div on hardware). RGB(255,128,0) packs as 0xFF8000 using shifts.

ASCII reference

ASCII assigns each printable English character a number 32–126. Each fits in a byte — the original 7-bit ASCII used codes 0–127. Hover any code; values are decimal / hex / binary.

Patterns to notice: 'A' is 65, 'a' is 97 — exactly 32 apart, so the case bit is 0x20. '0' is 48 (0x30), so the numeric value of digit char c is c − '0'. Spaces (32) and below are non-printable control codes.
0
Score
0
Streak
%
Question
Daily Bases
5 questions · same set for everyone today

Quick reference

Memorise these and most conversions become instant.

Powers of 2

Hex digit table

0–15 in every base

Common values

How to convert by hand

Decimal → BinaryDivide by 2 repeatedly. Read remainders bottom-up.
Example 13: 13÷2=6 r1, 6÷2=3 r0, 3÷2=1 r1, 1÷2=0 r1 → 1101
Binary → DecimalSum the powers of 2 where the bit is 1.
Example 1101: 8+4+0+1 = 13
Binary → HexGroup bits in 4s from the right; convert each group.
Example 1101 0010 → D2
Hex → BinaryReplace each digit with its 4-bit pattern.
Example AF → 1010 1111 → 10101111
Decimal → HexDivide by 16 repeatedly. Read remainders bottom-up (use A–F for 10–15).
Example 254: 254÷16=15 r14 (E), 15÷16=0 r15 (F) → FE