Binary Decimal Hex Octal Converter

Binary / Number Base Converter

Enter a number and select its base. All four representations are shown instantly.

Binary (Base 2)
Decimal (Base 10)
Octal (Base 8)
Hexadecimal (Base 16)

Binary, Decimal, Octal & Hexadecimal Converter

This free number base converter instantly translates any number between binary (base 2), decimal (base 10), octal (base 8), and hexadecimal (base 16). Just type your number, select its base, and all four representations update in real time. Supports integers up to 2³² (4,294,967,295).

The Four Number Systems

Binary (Base 2) uses only the digits 0 and 1. Every piece of data inside a computer is ultimately represented as binary. Decimal (Base 10) is the everyday number system using digits 0–9. Octal (Base 8) uses digits 0–7 and was common in early computing as a compact representation of binary (3 bits per octal digit). Hexadecimal (Base 16) uses digits 0–9 and letters A–F, representing values 0–15. It is the most common shorthand for binary data in modern computing — 8 bits fit neatly into exactly two hex digits.

Why Do Computers Use Binary?

Electronic circuits naturally represent two states: voltage high (1) or voltage low (0). All digital logic — from simple gates to complex processors — is built on these two states. Binary arithmetic maps directly to these physical states, making it the natural language of hardware. Higher-level number systems (hex, octal) are simply human-readable shortcuts for groups of binary digits.

Hexadecimal in Practice

Hex is ubiquitous in programming: memory addresses, colour codes (e.g., #FF5500), file headers, network MAC addresses, IPv6 addresses, and assembly language all use hexadecimal notation. Two hex digits represent exactly one byte (8 bits), making it much more compact than binary while remaining directly convertible.

Quick Conversion Tips

  • Binary to hex: group bits in fours from the right. Each group of 4 bits = one hex digit (e.g., 1111 = F).
  • Binary to octal: group bits in threes from the right. Each group of 3 bits = one octal digit (e.g., 111 = 7).
  • Hex to decimal: multiply each digit by its positional power of 16 and sum.

Frequently Asked Questions

How do I convert binary to decimal by hand?
Write the binary number and assign positional values from right to left: 1, 2, 4, 8, 16, 32, 64, 128, ... Multiply each bit by its positional value and add up the results. For example, 1011 = 8+0+2+1 = 11 in decimal.
Why is hexadecimal used in HTML colour codes?
Colours are defined by three bytes: Red, Green, and Blue, each ranging 0–255. Two hex digits represent one byte exactly (00–FF). So #RRGGBB is a compact 6-character code for any of 16.7 million colours, compared to three separate decimal numbers.
What is the largest number this converter handles?
This converter supports integers up to 2³² − 1 = 4,294,967,295. This is the range of an unsigned 32-bit integer. For larger numbers, specialised arbitrary-precision libraries are needed.
Is octal still used today?
Octal is less common today but still appears in Unix/Linux file permission codes (e.g., chmod 755 = rwxr-xr-x in binary permissions) and some programming languages like C and Python use the prefix "0o" for octal literals.
How do I enter hexadecimal numbers?
Select "Hexadecimal (Base 16)" from the base dropdown, then type digits 0–9 and letters A–F (or a–f). The converter accepts both upper and lowercase letters and shows all results in uppercase hex.