elefcode

Number Base Converter

Convert between binary, octal, decimal, and hexadecimal — live in every field.

Tip: enter a value in any field and the other three update instantly. Arbitrary-length integers are supported.

Advertisement

Guide

About the Number Base Converter

A number's base (or radix) is how many distinct digits it uses. Everyday numbers are decimal (base 10). Computers work in binary (base 2), which maps directly to on/off bits. Hexadecimal (base 16) is a compact way to write binary — each hex digit is exactly four bits — so it shows up in color codes, memory addresses, and byte dumps. Octal (base 8) appears in Unix file permissions. This converter translates a number between all four at once.

Enter a value in any field and the others update instantly. It uses big-integer arithmetic, so even very large numbers convert exactly without losing precision.

Why hexadecimal is everywhere

Binary is precise but unwieldy — a single byte is eight digits. Because 16 is a power of 2, one hex digit represents exactly four binary bits, so a byte fits in just two hex digits (00–FF). That tidy mapping is why colors (#FF8800), memory addresses, and hashes are written in hex: it's far more readable than binary while representing the same bits.

Reading each base

  • Binary — digits 0–1, often prefixed 0b.
  • Octal — digits 0–7, often prefixed 0o.
  • Decimal — digits 0–9, the everyday base.
  • Hexadecimal — digits 0–9 and A–F, often prefixed 0x.

How to use it

  1. 1Type a value into any one of the base fields.
  2. 2The other three bases update instantly.
  3. 3Copy whichever representation you need.
  4. 4Enter very large numbers freely — precision is preserved.

Frequently asked questions

How do I convert binary to decimal?

Enter the binary number in the binary field and read the decimal field. Under the hood, each bit is multiplied by its power of two and summed.

Why is hexadecimal used for colors and memory?

Because one hex digit equals exactly four binary bits, hex is a compact, readable stand-in for binary. A byte becomes two hex digits, which is why colors and addresses use it.

What do 0x, 0o, and 0b mean?

They are prefixes indicating the base: 0x for hexadecimal, 0o for octal, and 0b for binary. They tell humans and compilers how to interpret the digits that follow.

Can it handle very large numbers?

Yes. The converter uses big-integer arithmetic, so large values convert exactly without the rounding errors that floating-point math would introduce.

Is the conversion done locally?

Yes. Everything runs in your browser with no network requests.

Related tools