Stax

Number Base Converter

Convert numbers between binary, octal, decimal, and hexadecimal.

Binary
Base 2
Octal
Base 8
Decimal
Base 10
Hexadecimal
Base 16

Number systems in computing

Computers store and process everything as binary (base 2). But reading long strings of 1s and 0s is error-prone for humans, so we use more compact representations: octal (base 8) and hexadecimal (base 16). Each hex digit maps to exactly 4 binary bits, making the conversion lossless and mental.

Common uses by base

  • Binary — CPU instruction sets, bitmasking, flags, network subnet masks
  • Octal — Unix file permissions (chmod), some legacy protocols
  • Decimal — Human-readable numbers, port numbers, IP addresses
  • Hexadecimal — Memory addresses, color codes, SHA hashes, byte sequences, UUID values

Quick conversion reference

Memorizing a few hex-to-binary pairs makes manual conversion much faster: 0=0000, 1=0001, 4=0100, 8=1000, A=1010, F=1111. Any hex value can be converted to binary by simply substituting each hex digit with its 4-bit binary equivalent.

Frequently asked questions

What is a number base?
A number base (or radix) defines how many digits a numeral system uses. Decimal (base 10) uses 0–9. Binary (base 2) uses 0 and 1. Octal (base 8) uses 0–7. Hexadecimal (base 16) uses 0–9 and A–F.
Why do programmers use hexadecimal?
Hex is compact and maps neatly to binary: each hex digit represents exactly 4 binary bits (a nibble). This makes it easy to read memory addresses, color codes (#FF5733), file signatures, and bytecode without long binary strings.
How do I convert binary to decimal?
Multiply each bit by its positional value (powers of 2 from right to left) and sum the results. For example, 1010 in binary = 1×8 + 0×4 + 1×2 + 0×1 = 10 in decimal. This converter does it instantly for any base.
What is octal used for?
Octal was common in early computing and is still used in Unix/Linux file permission notation (e.g., chmod 755). Each octal digit represents exactly 3 bits, making it a compact alternative to binary.
What is the nibble grouping in binary?
Nibble grouping splits binary output into groups of 4 bits (e.g., 1010 1101 instead of 10101101). This matches hex digit boundaries, making it easier to convert mentally between binary and hexadecimal.

Related tools