LOCAL TOOL · DEV

Number Base Converter

Binary, octal, decimal and hex both ways, with the working shown.

Whole numbers only; numbers with a fractional part aren't converted.

Binary (BIN)
Octal (OCT)
Decimal (DEC)
Hexadecimal (HEX)
Two's complement view
Working

    Nothing you type is saved or sent.

    How to use

    1. Type a number into the box for its base (0x, 0b and 0o prefixes work).
    2. The other boxes update right away; use Copy to take a result.
    3. Pick a from/to base under Working to see the division or place-value steps.
    4. To see a negative number the way computers store it, pick a two's complement width.

    Examples

    255 → 11111111 · 377 · ff

    Decimal 255 → binary 11111111 · octal 377 · hex ff. Working (10→16): 255 ÷ 16 = 15 remainder 15 (f), 15 ÷ 16 = 0 remainder 15 (f) → read bottom to top: ff.

    FAQ

    How do I convert decimal to binary?

    Keep dividing by 2 until the quotient is 0, then read the remainders from bottom to top: 13 → 1101. For octal or hex, divide by 8 or 16 the same way.

    How do I convert binary to decimal?

    Multiply each digit by its place value (a power of 2) and add them up: 1101 = 1×8 + 1×4 + 0×2 + 1×1 = 13.

    Is there a shortcut from binary to octal or hex?

    Group the bits from the right: threes give octal digits, fours give hex digits. 11111111 → 011 111 111 = 377, and 1111 1111 = ff.

    How are negative numbers handled?

    The minus sign is kept (−255 → -ff). To see how a computer stores it, pick a two's complement width. Binary you type in is never read as two's complement.

    What about fractions or very large numbers?

    Fractions aren't supported. Whole numbers up to 1,000 digits are converted exactly, with no rounding.

    Can I use it to check practice problems?

    Yes. Set the working to the same bases as the problem and compare each step. Nothing you type is saved or sent.