Binary, hex, octal and decimal converter

A number base is the count of digits a positional number system uses: binary uses 2, octal 8, decimal 10, and hexadecimal 16.

Convert numbers between binary, octal, decimal and hexadecimal, with 8- to 64-bit word sizes and two's complement. Free and works in your browser.

Browser-sideNo accountCopy, download, or print

Last reviewed

Your inputs are saved as a draft in this browser only. Nothing is uploaded.

Jump to result
Interactive workspace

Inputs

Result

More export options

Decimal255
HexadecimalFF
Octal377
Word size16-bit unsigned
Decimal: 255
Binary: 0000 0000 1111 1111
Octal: 377
Hexadecimal: FF

How to use it

  1. Choose the input base: binary, octal, decimal, or hexadecimal.
  2. Enter the number; prefixes such as 0b, 0o, and 0x are accepted.
  3. Pick a word size and switch to two's complement if you need signed interpretation.
  4. Generate the conversion to read the value in all four bases, then copy the result.

Questions

How does the two's complement conversion work?
The value is masked to your chosen word size, and in signed mode a set top bit makes the decimal output the negative two's complement value.
Why is the binary output padded with zeros?
Binary is padded to the selected word size of 8, 16, 32, or 64 bits, and grouped into blocks of four digits when grouping is on, so bit positions line up for comparison.
Is the number sent to a server?
No. The conversion runs entirely in your browser and nothing is uploaded.
What is 255 in binary and hexadecimal?
255 is 11111111 in binary and FF in hexadecimal, the largest value that fits in 8 bits. In 8-bit two's complement the same bits mean -1.