How To Convert Between Number Bases
📖 Bu rehber ToolPazar ekibi tarafından hazırlanmıştır. Tüm araçlarımız ücretsiz ve reklamsızdır.
What a “base” actually is
Binary, octal, decimal, hexadecimal — four number bases cover 99% of what programmers run into. Converting between them is straightforward once you see the pattern, and essential for reading memory dumps, understanding flags, decoding Unicode, working with permissions, or debugging low-level systems. This guide covers the math (it’s all just grouping bits differently), the shortcuts between binary and hex that make mental conversion fast, real uses of each base, and when you should reach for a tool instead of doing it by hand.
The four bases you’ll meet in practice
A number base is the count of unique digits used to represent values. Decimal uses 10 (0-9); binary uses 2 (0-1); hexadecimal uses 16 (0-9, A-F).
Decimal → binary
Each digit position represents a power of the base. In decimal, the number 345 means 3×100 + 4×10 + 5×1 — powers of 10 (10^2, 10^1, 10^0).
Binary → decimal
In binary, 101 means 1×4 + 0×2 + 1×1 = 5 — powers of 2.
Binary ↔ hex — the shortcut
In hex, 2F means 2×16 + 15 = 47 — powers of 16.
Binary ↔ octal — same idea, groups of 3
Repeatedly divide by 2 and record remainders; read remainders bottom-up.
Decimal ↔ hex
Example: 13 in binary.
Reading code — base prefixes
13 / 2 = 6 remainder 1
Why hex for colors, memory, and hashes
6 / 2 = 3 remainder 0
Octal for Unix permissions
3 / 2 = 1 remainder 1
Bitwise operations — when base matters
1 / 2 = 0 remainder 1
Two’s complement — negative binary
Read bottom-up: 1101. Verify: 8 + 4 + 0 + 1 = 13. ✓
Common mistakes
Multiply each bit by its power of 2 and sum.
Run the numbers
Example: 10110 in decimal.