Free Number Base Converter โ€” Binary, Hex, Decimal, Octal

Convert any number between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16) instantly. Results update as you type โ€” no button clicks needed.

Advertisement ยท 728ร—90

Enter a Number

Advertisement ยท 300ร—250

Enter a number above to see conversions across all bases.

Understanding Number Bases

A number base (or radix) defines how many unique digits a positional numeral system uses before carrying over to the next place value. In our everyday decimal system we use base 10 โ€” digits 0 through 9. When counting reaches 9, the next number is represented by carrying 1 into the next position and resetting the current position to 0, giving us 10. The same principle applies to every number base: the base determines when a "carry" occurs.

Computers and digital electronics work exclusively with binary (base 2) at the hardware level, since electronic circuits can reliably represent two voltage states: off (0) and on (1). Every instruction your CPU executes, every byte of memory, and every pixel on your screen is ultimately represented as a sequence of binary digits (bits). Understanding number bases is therefore a foundational skill for anyone working in computing, electronics, or software engineering.

Binary (Base 2) โ€” The Language of Computers

Binary uses only two digits: 0 and 1. Each digit is called a bit (binary digit). Groups of 8 bits form a byte, which can represent 256 unique values (2โธ = 256). Binary is used everywhere in computing: CPU instructions, memory addresses, file storage, network packets, and cryptographic operations all operate on binary data at their lowest level.

Reading binary numbers directly is difficult because even small decimal numbers become long strings of 0s and 1s. The decimal number 255, for example, is 11111111 in binary โ€” 8 bits all set to 1. This is why hexadecimal was introduced as a human-readable shorthand for binary data: each hexadecimal digit exactly represents 4 binary bits, making it easy to convert between the two without arithmetic.

Hexadecimal (Base 16) โ€” Compact Binary Notation

Hexadecimal (hex) uses 16 digits: 0โ€“9 and Aโ€“F (where A = 10, B = 11, C = 12, D = 13, E = 14, F = 15). Because 16 = 2โด, one hex digit maps perfectly to exactly 4 binary bits, making hex a compact and human-readable representation of binary data. You see hex constantly in computing:

  • CSS colour codes: #FF5733 is three hex pairs representing red (FF = 255), green (57 = 87), and blue (33 = 51) channels.
  • Memory addresses: Debuggers and disassemblers display memory addresses in hex: 0x7FFF5FBFF8A0.
  • Byte representations: Hex dumps of binary files show each byte as a two-character hex string, making binary data inspectable.
  • Cryptographic hashes: SHA-256 hashes are displayed as 64-character hex strings (256 bits รท 4 bits per hex digit).
  • MAC addresses and IP addresses: IPv6 addresses and hardware MAC addresses use hexadecimal notation.

Octal (Base 8)

Octal uses digits 0โ€“7 and was historically important in computing when machines grouped bits in threes rather than fours. Today, octal is most commonly encountered in Unix/Linux file permission notation: chmod 755 sets permissions using three octal digits, each representing a group of three permission bits (read = 4, write = 2, execute = 1). Octal is also used in some assembly languages and embedded systems programming.

Decimal (Base 10) โ€” Everyday Counting

Decimal is the number system humans use naturally, likely because we have 10 fingers. While computers never use decimal internally (except in specialised decimal floating-point formats), decimal is the base used for all human-facing numerical output. Converting between decimal and the other bases is a common task in programming, algorithm design, and hardware engineering.

Frequently Asked Questions

To convert a decimal number to binary, repeatedly divide the number by 2 and record the remainders. Reading the remainders from bottom to top gives you the binary representation. For example: 13 รท 2 = 6 remainder 1; 6 รท 2 = 3 remainder 0; 3 รท 2 = 1 remainder 1; 1 รท 2 = 0 remainder 1. Reading remainders bottom to top: 1101. So decimal 13 = binary 1101. This tool does all that arithmetic instantly.

Hexadecimal is used because it is a compact shorthand for binary. Since 16 = 2โด, every 4 binary bits correspond to exactly one hex digit. This means an 8-bit byte (like 11110000) can be written as two hex digits (F0), and a 32-bit integer can be written as 8 hex digits instead of 32 binary digits. Hex is much easier for humans to read, write, and remember while remaining directly convertible to binary without any arithmetic.

Bit length indicates the minimum number of bits required to represent the number in binary. For example, the decimal number 255 requires exactly 8 bits (11111111), so it is an 8-bit number. The bit length also determines how the grouped binary display is formatted. Numbers up to 8 bits are shown as 8-bit, up to 16 bits as 16-bit, and larger values as 32-bit groups of 4 bits separated by spaces for readability.

This tool uses JavaScript's built-in number type, which safely represents integers up to 2โตยณ - 1 (9,007,199,254,740,991 in decimal, or about 9 quadrillion). Numbers larger than this may lose precision due to floating-point representation. A note is displayed if the input exceeds this safe integer limit. For very large numbers (64-bit integers, cryptographic values), consider using a tool that supports arbitrary-precision arithmetic.

Each base only allows specific digit characters: Binary (base 2) accepts only 0 and 1. Octal (base 8) accepts digits 0 through 7. Decimal (base 10) accepts digits 0 through 9. Hexadecimal (base 16) accepts digits 0โ€“9 and letters Aโ€“F (case-insensitive). Entering an invalid character for the selected base will display a validation error and the converter will not produce output until the input is corrected.

Unix/Linux file permissions are represented as three groups of three bits: owner, group, and others. Each group has read (r = 4), write (w = 2), and execute (x = 1) permissions. Since each group can represent values 0โ€“7, octal notation is a natural fit. For example, chmod 755 sets owner to rwx (7 = 111 in binary), group to r-x (5 = 101), and others to r-x (5 = 101). You can use this converter to see what any octal permission value looks like in binary.

Related Free Tools

Need a custom tool built for your business?

Get a Free Quote