Number Base Converter

Number Base Converter

Convert numbers between decimal, hexadecimal, binary, and octal in real time. All computation runs in your browser.

Decimal (base 10)
—
Hexadecimal (base 16)
—
Binary (base 2)
—
Octal (base 8)
—

About the Number Base Converter

Computers store everything in binary (base 2), programmers often read memory, colours and bit masks in hexadecimal (base 16), Unix permissions are written in octal (base 8), and people think in decimal (base 10). Switching between them is part of everyday work with flags, protocols, colour codes, file formats and low-level debugging.

This converter keeps decimal, hexadecimal, binary and octal in sync as you type in any of them. It also shows how the value reads as a signed and unsigned 32-bit integer and how many bits it needs. It uses arbitrary-precision arithmetic, so large values convert without losing precision.

Common uses

  • Reading hex values from memory dumps, packet captures or error codes such as 0x80070005.
  • Building and checking bit masks and feature flags.
  • Converting octal file permissions to binary to understand them.
  • Learning and teaching number systems.

How to use it

  1. Type a number into any of the four fields: decimal, hexadecimal, binary or octal.
  2. The other fields update instantly.
  3. Check the additional information for signed and unsigned 32-bit values and bit length, and copy what you need.

Example

One value in all four bases:

Input
Decimal: 255
Output
Hex:    FF
Binary: 11111111
Octal:  377
Bit length: 8

Tips and common pitfalls

  • Each hex digit is exactly four binary digits, so 0xA5 is 1010 0101. This is why hex is the preferred shorthand for binary.
  • Each octal digit is three bits, which matches the read/write/execute triplets in Unix permissions: 7 = 111 = rwx.
  • Negative numbers in most languages use two's complement: -1 as a 32-bit integer is 0xFFFFFFFF, which is 4,294,967,295 when read as unsigned.
  • Prefixes vary by language: 0x for hex, 0b for binary and 0o (or a leading 0 in C) for octal.

Frequently asked questions

Why do programmers use hexadecimal?

It is a compact, human-friendly way to write binary: one byte is always exactly two hex digits, which makes memory addresses, colours and byte sequences easy to read.

What is the largest number I can convert?

Conversions use arbitrary-precision integers, so values far larger than 64 bits convert accurately.

What do signed and unsigned 32-bit mean?

They are two ways of interpreting the same 32 bits. Unsigned values range from 0 to 4,294,967,295; signed values use the top bit for the sign and range from −2,147,483,648 to 2,147,483,647.

Does it support fractions?

No. The converter works with whole numbers, which covers almost all programming uses of other bases.

Related