Number Base Converter

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

Data

How number bases work

A number base (or radix) determines how many unique digit symbols are used to represent numbers. In base 10 (decimal), we use 10 symbols: 0–9. In base 2 (binary), we use 2 symbols: 0 and 1. In base 16 (hexadecimal), we use 16 symbols: 0–9 and A–F, where A=10, B=11, C=12, D=13, E=14, and F=15.

Binary is the native language of computers — every piece of data is ultimately stored as sequences of bits (binary digits). Understanding binary helps with bitwise operations, network subnet masks, file permissions in Unix (chmod 755 is octal), and cryptographic values. Hexadecimal is a compact representation of binary: each hex digit represents exactly 4 binary digits (a nibble), so two hex digits represent one byte. This is why colour codes like #FF6B35 have 6 hex characters — 2 for red, 2 for green, 2 for blue, each in the range 00–FF (0–255).

Octal (base 8) is less commonly used today but appears in Unix file permissions (chmod 644), legacy data formats, and some programming languages. Converting between bases uses the algorithm of repeatedly dividing by the target base and collecting remainders.

Common mistakes

  • Leading zeros in binary — Binary representations are often shown with leading zeros to pad to 8-bit (byte) or 16-bit boundaries. 5 in decimal is 00000101 in 8-bit binary, not just 101.
  • Signed vs unsigned — This tool converts unsigned integers. Negative numbers in binary use two's complement representation, which is different from simply placing a minus sign before the binary digits.