lifekit

Search tools

Type a tool name, then press Enter to open it.

Number base converter

Convert numbers between binary, octal, decimal, hex and any base from 2 to 36, exactly at any size, with division steps and two's complement.

  • Free
  • Runs in your browser
  • Nothing is uploaded

How to use it

  1. Type a number into any field: decimal, binary, octal, hexadecimal or a base you choose from 2 to 36.
  2. Every other field converts as you type, exactly, even for very large numbers.
  3. Pick which base to show the work for and follow the repeated division and place-value steps.
  4. For negative numbers, pick a bit width to see the two's complement pattern.

Private by design

Everything runs on your device. Nothing you enter or open here is uploaded.

Questions

Divide the number by 2 repeatedly and write down each remainder, then read the remainders from bottom to top. 13 ÷ 2 = 6 r 1, 6 ÷ 2 = 3 r 0, 3 ÷ 2 = 1 r 1, 1 ÷ 2 = 0 r 1, so 13 is 1101 in binary.

Multiply each digit by its place value, a power of 2, and add the results. 1101 is 1 × 8 + 1 × 4 + 0 × 2 + 1 × 1 = 13.

Multiply each hex digit by a power of 16 and add them up, with A to F standing for 10 to 15. CA is 12 × 16 + 10 × 1 = 202.

Two's complement is how computers store negative whole numbers in a fixed number of bits. To get it, write the positive number in binary, flip every bit and add 1, so −5 in 8 bits is 1111 1011.

It converts between every base from 2 to 36. Bases above 10 use the letters A to Z as digits, so base 36 uses 0–9 and A–Z.