Number Base Converter

Type a number, say which base it is in, and see it in binary, octal, decimal and hexadecimal at the same time, plus any other base from 2 to 36. Very long numbers stay exact. If you type a digit that does not belong in the base, the page points to it. For negative numbers you also get the 8, 16, 32 and 64-bit two's complement patterns.

A minus sign and 0b, 0o or 0x prefixes are fine. Spaces and underscores are ignored.

Input is in

Binary and hex in fours, octal and decimal in threes

FF instead of ff

Binary (base 2)
11111111
Octal (base 8)
377
Decimal (base 10)
255
Hexadecimal (base 16)
FF
73

Every calculation runs in your browser. What you type never leaves this device.

Features

  • Binary, octal, decimal and hex side by side

  • Any base from 2 to 36, in and out

  • No size limit worth worrying about: up to 2,000 digits, exact

  • Negative numbers with a minus sign

  • Accepts 0b, 0o and 0x prefixes, spaces and underscores

  • Clear error naming the wrong digit and its position

  • Optional digit grouping and upper-case letters

  • Two's complement in 8, 16, 32 and 64 bits for negative values

Who uses it

Computer science students

Check number-system conversions from Class 11 computer science, BCA, B.Tech and GATE practice.

Programmers

Turn hex colour or memory values into decimal, read bit masks in binary, or check how a negative int is stored.

Electronics

Convert register values and port settings between hex and binary while working with microcontrollers.

Short IDs

Write large numbers compactly in base 36 using 0-9 and a-z.

How number bases work

Place value in any base

In base 10 each place is worth ten times the one to its right. In base 2 each place is worth twice as much: 1011 in binary is 1×8 + 0×4 + 1×2 + 1×1 = 11. Bases above 10 use letters for the extra digits, so in hex A = 10 and F = 15, and FF = 15×16 + 15 = 255.

Quick conversions between binary, octal and hex

  • Each hex digit is exactly 4 binary digits: F = 1111, so FF = 1111 1111.
  • Each octal digit is exactly 3 binary digits: 7 = 111.
  • That is why grouping binary in fours makes hex easy to read off.

Negative numbers and two's complement

Written by hand, a negative number just takes a minus sign (−1010 in binary is −10). Computers store fixed-width integers in two's complement instead: flip every bit of the positive value and add 1. In 8 bits, −1 is 11111111 and −128 is 10000000. The converter shows these patterns for any negative value that fits.

Related tools

Convert colours between HEX, RGB and HSL with the colour converter, and Unix timestamps with the timestamp converter.

Number Base Converter - FAQ