Skip to main content

    Number Base Converter

    Convert numbers between different bases seamlessly.

    Decimal

    42

    Binary

    101010

    Hexadecimal

    2A

    Octal

    52

    How number base conversion works

    Every positional numeral system expresses a value as a sum of digits multiplied by powers of its base. Decimal (base 10) uses the digits 0-9, binary (base 2) uses 0 and 1, octal (base 8) uses 0-7, and hexadecimal (base 16) adds A-F to represent the values ten through fifteen. Converting between bases never changes the underlying quantity — only the notation. This converter parses your input in the base you select, holds it as an exact integer, and re-encodes it in each target base, so the round trip is lossless for any whole number your browser can represent.

    When you need each base

    Binary mirrors how hardware actually stores data, which makes it the natural view for bit masks, flags and permission bits. Hexadecimal compresses four binary digits into one character, so it dominates memory addresses, colour codes such as #1A2B3C, hashes and byte dumps. Octal groups three bits at a time and survives mainly in Unix file permissions like chmod 755. Decimal remains the human-facing default. Engineers move between all four constantly while debugging, reading protocol specifications or interpreting register values.

    Accuracy and privacy

    Conversion runs entirely in your browser using native integer parsing — nothing is uploaded, logged or stored. Invalid digits for the chosen base are rejected rather than silently truncated, so a value like 1092 will not be accepted as binary. For very large numbers, verify against arbitrary precision tooling: JavaScript numbers are exact only up to 253 − 1.