ToolSnap

Number Base Converter

Type a number in any base โ€” all other bases update instantly.

BIN

Binary

0b

OCT

Octal

0o

DEC

Decimal

HEX

Hexadecimal

0x

What is Number Base Conversion?

Number base conversion translates a value from one positional numeral system to another โ€” for example, from decimal (base 10) to hexadecimal (base 16) or binary (base 2). Every programmer, network engineer, and embedded developer encounters this regularly when reading memory addresses, CSS color codes, Unix file permissions, subnet masks, or raw binary data.

ToolSnap's number base converter supports binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Enter a value in any base and instantly see the equivalent in all other bases. All conversion happens in your browser โ€” nothing is sent to a server.

The Four Common Bases

  • Binary (base 2) โ€” Uses digits 0 and 1. Each position is a power of 2. Fundamental to hardware, bitwise operations, and network masks.
  • Octal (base 8) โ€” Uses digits 0โ€“7. Each position is a power of 8. Still used for Unix file permissions (e.g. chmod 755).
  • Decimal (base 10) โ€” Uses digits 0โ€“9. The everyday number system humans use.
  • Hexadecimal (base 16) โ€” Uses digits 0โ€“9 and letters Aโ€“F. Each position is a power of 16. Compact way to represent bytes and memory addresses.

How Base Conversion Works

In any positional system, each digit represents a coefficient multiplied by a power of the base. Decimal 354 means 3ร—10ยฒ + 5ร—10ยน + 4ร—10โฐ. Binary 1011 means 1ร—2ยณ + 0ร—2ยฒ + 1ร—2ยน + 1ร—2โฐ = 11 in decimal. Hexadecimal 2F means 2ร—16ยน + 15ร—16โฐ = 47 in decimal.

To convert from any base to decimal, multiply each digit by its place value and sum the results. To convert from decimal to another base, repeatedly divide by the target base and read the remainders in reverse order.

Real-World Uses

  • CSS colors โ€” #FF6B35 is three pairs of hex bytes for red, green, and blue (0โ€“255 each).
  • Memory addresses โ€” Debuggers display addresses like 0x7FFF5FBFFA10 because hex is more compact than binary.
  • Unix permissions โ€” chmod 755 means owner rwx (7), group rx (5), others rx (5) in octal.
  • Subnet masks โ€” A /24 network mask is 24 ones followed by 8 zeros in binary: 255.255.255.0.
  • Bit flags โ€” Feature toggles and permission masks combine individual bits: Read (4) + Write (2) + Execute (1) = 7.

Frequently Asked Questions

Why do programmers prefer hexadecimal?

One hex digit represents exactly four bits (a nibble), and two hex digits represent one byte. This makes hex a compact, readable representation of binary data. Reading FA is easier than 11111010.

Can I enter letters in hex values?

Yes. Hexadecimal uses Aโ€“F (or aโ€“f) for values 10โ€“15. The tool accepts both uppercase and lowercase letters.

What happens if I enter an invalid digit for a base?

Each base only allows specific digits. Binary accepts 0 and 1 only; octal accepts 0โ€“7; decimal accepts 0โ€“9; hex accepts 0โ€“9 and Aโ€“F. Invalid characters produce a clear error rather than a wrong result.