Number Base Converter

Convert numbers between binary, octal, decimal and hex.

100% private - files never leave your browser

Loading tool…

Share:WhatsAppFacebookX

Convert a number between the four bases developers use most: binary, octal, decimal and hexadecimal. Enter a value in any base and see all the others update live. It is a quick helper for programming, networking and digital electronics, and runs entirely in your browser.

Why programmers use other bases

Decimal is convenient for people and awkward for machines. Binary reflects how hardware actually stores values, and hexadecimal is a compact way of writing binary, because each hex digit maps exactly to four bits. That is why memory addresses, colour codes and permission flags are written in hex: it is far shorter than binary and converts back to it without any arithmetic.

Where each one shows up

  • Binary: bit flags, permissions, and anything working at the level of individual bits.
  • Octal: Unix file permissions, which is why chmod 755 has three digits.
  • Decimal: everything a person reads.
  • Hexadecimal: colour codes, memory addresses, byte values and hashes.

Reading the notation

Prefixes tell you which base a number is written in, and mixing them up produces confusing bugs. 0b marks binary, 0o marks octal, and 0x marks hexadecimal. Without a prefix, 10 is ten in decimal, two in binary, eight in octal and sixteen in hex, so the same characters mean four different values. When a number appears in configuration or code, check the prefix before assuming.

How to use Number Base Converter

  1. 1

    Enter a number in any base.

  2. 2

    See it converted to the other bases.

  3. 3

    Copy the value you need.

Frequently asked questions

Binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16).