Number Bases Q&A: Your 12 Most Common Conversion Questions Answered

Every week someone asks me why their hex code looks "wrong," or why binary numbers always seem to balloon into ridiculous strings of ones and zeros. After years of explaining number base conversion — to students, developers, and the occasional very confused designer — I've noticed the same twelve questions come up again and again. So here they are, answered directly, without padding.


Q1: What does "base" actually mean? I keep hearing "base 10" and "base 2" but nobody explains it.

Base tells you how many unique digits the system has. Base 10 (decimal) uses ten digits: 0 through 9. Once you hit 9, you roll over to the next column — which is why 9 + 1 = 10. Base 2 (binary) only has two digits: 0 and 1. So you roll over much faster: 1 + 1 in binary = 10 (which equals decimal 2). The base also tells you the value of each position: in base 10, columns represent ones, tens, hundreds; in base 2, they represent ones, twos, fours, eights.


Q2: Why do computers use binary instead of just… decimal?

Because hardware is made of switches — transistors that are either off (0) or on (1). Building a reliable physical switch with ten stable states is an engineering nightmare. Two states? Dead simple. Reliability is why binary stuck, not because anyone particularly loves reading streams of ones and zeros.


Q3: How do I convert decimal to binary without a calculator?

Repeated division by 2. Take your number, divide by 2, write down the remainder, then divide the quotient again. Keep going until you hit zero. Then read the remainders bottom to top.

Example: convert 45 to binary.

  • 45 ÷ 2 = 22 remainder 1
  • 22 ÷ 2 = 11 remainder 0
  • 11 ÷ 2 = 5 remainder 1
  • 5 ÷ 2 = 2 remainder 1
  • 2 ÷ 2 = 1 remainder 0
  • 1 ÷ 2 = 0 remainder 1

Read bottom to top: 101101. Check: 32+8+4+1 = 45. Correct.


Q4: What's octal? I almost never see it mentioned.

Octal is base 8 — digits 0 through 7. It was genuinely useful in older computing because early machines grouped bits in threes, and three binary digits map perfectly to one octal digit. These days it mostly shows up in Unix file permissions (chmod 755, for instance — 7 is 111 in binary, meaning read+write+execute). Outside of that context you'll rarely encounter it, but it's worth knowing when it appears so you don't mistake it for decimal.


Q5: Hex confuses me. Why do letters appear in numbers?

Hexadecimal is base 16, which needs 16 distinct symbols. Digits 0–9 cover the first ten, but then you need six more. Rather than invent new symbols, the convention grabbed A through F. So A=10, B=11, C=12, D=13, E=14, F=15. That means FF in hex = (15 × 16) + 15 = 255 in decimal — which is why 255 is the maximum value for a single color channel in RGB.


Q6: Is there a fast mental trick for converting hex to binary?

Yes, and this one is actually elegant: each hex digit converts directly to exactly four binary digits (nibbles). Memorize just sixteen mappings and you can convert any hex string in your head, one character at a time.

The ones worth memorizing first:

  • 0 = 0000, 1 = 0001, 2 = 0010, 4 = 0100, 8 = 1000
  • F = 1111, E = 1110, C = 1100, A = 1010

So 3A in hex → 0011 1010 in binary. No long division required.


Q7: I'm doing web design. What's the hex color #1A9E4B actually saying?

It's giving you three two-digit hex values, each representing one color channel:

  • 1A = Red → 1×16 + 10 = 26 out of 255 (almost none)
  • 9E = Green → 9×16 + 14 = 158 out of 255 (medium-high)
  • 4B = Blue → 4×16 + 11 = 75 out of 255 (low-medium)

So it's a medium-dark green. The high green channel combined with low red and moderate blue is exactly what creates that forest-green feel. Once you internalize the two-digit hex → 0–255 mapping, you can roughly "read" colors from their hex codes without picking them.


Q8: What about three-digit hex colors like #F3A? Are those the same?

Three-digit hex is shorthand — each digit gets doubled. So #F3A expands to #FF33AA: full red (255), low-ish green (51), medium-high blue (170). It only works when both digits of each channel are identical. If your color is #1A9E4B, there's no valid three-digit shorthand — you must write all six characters.


Q9: Unix timestamps are numbers too, right? How do I read them?

A Unix timestamp is the count of seconds elapsed since January 1, 1970, 00:00:00 UTC — that moment is called the Unix epoch. At the time this was written, the timestamp is somewhere around 1,750,000,000. The number isn't in a different base — it's plain decimal — but it can look cryptic because it's just a large integer. To convert it mentally, a rough anchor: 1,000,000,000 seconds from the epoch landed on September 9, 2001. Every additional 31,536,000 seconds is another year.

Practically, you'll use a tool or a one-liner: in Python, datetime.fromtimestamp(1750000000) gives you the human-readable date instantly.


Q10: Why do some timestamps have 13 digits instead of 10?

Because they're measuring milliseconds instead of seconds. JavaScript's Date.now() returns milliseconds since the epoch — so a typical value looks like 1750000000000 rather than 1750000000. Divide a 13-digit timestamp by 1,000 and you're back to the familiar 10-digit second-based format. The mismatch between JS timestamps and Unix timestamps trips up a lot of backend developers when the two systems interact.


Q11: Is there a way to spot which base a number is written in just by looking at it?

Sometimes. A few conventions help:

  • Prefix 0x means hexadecimal — 0x2F is hex.
  • Prefix 0b means binary — 0b101101 is binary (that's 45).
  • Prefix 0 (leading zero) in older C-style code means octal — 0755 is octal, not seven hundred fifty-five decimal.
  • Letters A–F present with no prefix almost certainly means hex.
  • Only 0s and 1s with no prefix — probably binary, but could also be a small decimal number. Context matters.

When there's no prefix and no letters, you genuinely cannot tell if 101 is binary (= 5), octal (= 65), or decimal (= 101) without more context. Always specify the base when ambiguity matters.


Q12: What's the fastest way to convert between any of these bases without making mistakes?

The reliable method that works for everything: convert through decimal as your intermediate step. Going from octal to hex? Convert octal → decimal first, then decimal → hex. It adds one step but eliminates the mental gymnastics of trying to convert directly between non-decimal bases.

For binary ↔ hex specifically, the nibble trick from Q6 is faster and more reliable than going through decimal. Four binary digits = one hex digit, every time, no exceptions.

For anything involving real code, use language built-ins rather than hand calculations under pressure:

  • Python: int('2F', 16) converts hex to decimal; hex(47) goes back.
  • JavaScript: parseInt('2F', 16) and (47).toString(16).
  • Most Unix shells: printf '%d\n' 0x2F works too.

One Last Thing

The thing that finally made these conversions click for me wasn't memorizing procedures — it was understanding that all these systems are describing the same underlying quantity, just with different symbols and different column values. Once that lands, the mechanics follow naturally. Binary isn't "harder" than decimal; it just runs out of digits sooner and needs more columns to represent the same number. Hex isn't magic; it's a compression of binary that maps so cleanly because 16 is a power of 2. The bases are lenses, not different mathematical realities.

If any of these twelve questions led you here and you're still fuzzy on something, the answer is almost always: slow down, expand the number position by position, and ask "what is each column worth in this base?" The rest follows.