keencalculator
  1. Home
  2. Tech & Screens
  3. Number Base Converter

Number Base Converter

Convert a whole number between binary, octal, decimal and hexadecimal. Type the number, say which base it is in and which you want, and all four representations are shown together. Very long values are handled exactly.

Quick examples

Whole numbers only. Spaces and a 0x, 0b or 0o prefix are fine.

Your numbers stay in your browser. Nothing is uploaded.
Result11111111
Binary
11111111
Octal
377
Decimal
255
Hexadecimal
FF
Bits needed
8

Saved setups

Save a set of inputs you reuse — your usual rate, your loan, your room sizes — and load it back in one tap.

    Your recent calculations

    Results you calculate here are kept on this device so you can come back to them.

      Formula

      Value = Σ digit × base^position, counting positions from 0 at the right
      To convert from decimal: divide by the new base repeatedly and read the remainders from last to first
      One hex digit = 4 binary digits; one octal digit = 3 binary digits

      How to use it

      1. Type the number. Spaces and a 0x, 0b or 0o prefix are ignored.
      2. Choose the base it is written in.
      3. Choose the base to convert to; the other bases are listed below the result.

      Worked examples

      Decimal 255 to binary

      Result
      11111111
      Hexadecimal
      FF
      Octal
      377
      Bits needed
      8

      Binary 1011 0110 to decimal: 128 + 32 + 16 + 4 + 2

      Result
      182
      Hexadecimal
      B6
      Octal
      266

      Hexadecimal 0x1F4 to decimal: 1 × 256 + 15 × 16 + 4

      Result
      500
      Binary
      111110100
      Octal
      764
      Bits needed
      9

      The four bases

      Binary (base 2) uses 0 and 1 and is how computers store everything. Octal (base 8) uses 0–7 and survives mainly in Unix file permissions such as 755. Decimal (base 10) is everyday counting. Hexadecimal (base 16) uses 0–9 and A–F, where A is 10 and F is 15, and is the compact way to write bytes, memory addresses and colors.

      Converting by hand

      To read binary, add the place values of the 1s: 1011 0110 is 128 + 32 + 16 + 4 + 2 = 182. Hex and binary convert digit by digit, because each hex digit stands for exactly four bits: B is 1011 and 6 is 0110, so 1011 0110 is B6.

      Questions people ask

      What is 255 in binary?

      11111111 — eight 1s, the largest value that fits in one byte. In hexadecimal it is FF.

      What is FF in decimal?

      255: 15 × 16 + 15.

      Does it convert fractions or negative numbers?

      Negative whole numbers are shown with a minus sign rather than in two’s complement. Fractions are not supported.

      Related calculators