Number System Converter

Binary (Base 2) · Octal (Base 8) · Decimal (Base 10) · Hex (Base 16)

Convert any integer between binary, octal, decimal, and hexadecimal number bases instantly. Essential for programmers, computer science students, and anyone working with low-level data representation.

Quick Reference

255 dec = FF hex = 11111111 bin
0x1A = 26 dec
chmod 755 = 111 101 101 bin

Number System Reference Table

DecimalBinaryOctalHex
0000000
1000111
81000108
10101012A
15111117F
16100002010
2611010321A
64100000010040
1281000000020080
25511111111377FF
256100000000400100
1023111111111117773FF

About Number Systems

A number system (or numeral system) is a way of expressing numbers using a set of symbols and rules. The base (or radix) determines how many unique digits exist. Decimal (base 10) uses 0–9 and is used in everyday life. Binary (base 2) uses only 0 and 1 and underpins all digital computing. Every file, image, and instruction your computer executes is ultimately encoded as binary.

Hexadecimal (base 16) uses 0–9 and A–F, compactly representing 4 bits per digit — making it ideal for memory addresses, colour codes, and byte data. Octal (base 8) uses 0–7 and was popular in older Unix systems for file permissions. Understanding these bases is essential for programming, networking, electronics, and computer science.

Common Base Conversions

0xFF = 255 decimal
0x0F = 15 decimal
0b1010 = 10 decimal
100 decimal = 64 hex
256 decimal = 100 hex
1024 decimal = 400 hex
0777 octal = 511 decimal
0644 octal = 420 decimal
11111111 bin = FF hex
10000000 bin = 128 decimal

Worked Examples

255 to Binary

Divide by 2 repeatedly: 255→1, 127→1, 63→1, 31→1, 15→1, 7→1, 3→1, 1→1

Read remainders bottom-to-top:

= 11111111 (binary)

FF hex to Decimal

F = 15, so FF = (15 × 16¹) + (15 × 16⁰)

= 240 + 15 = 255

= 255 decimal

777 Octal to Decimal

(7 × 8²) + (7 × 8¹) + (7 × 8⁰)

= 448 + 56 + 7 = 511

= 511 decimal

42 Decimal to All Bases

42 ÷ 2 repeatedly → binary 101010

42 ÷ 16 = 2 R10 → hex 2A

= 101010 bin · 2A hex · 52 oct

When You Need Base Conversion

Programming

Interpret binary flags, bitmasks, and memory addresses in C, Python, Java, and assembly code.

Networking

Read IPv4 addresses, subnet masks, and MAC addresses — all commonly expressed in hex or binary.

Colour Codes

Decode and encode CSS hex colours like #FF5733 into their red, green, and blue decimal components.

File Permissions

Unix chmod values like 755 are octal — convert to binary (rwxr-xr-x) to understand permission bits.

Electronics

Microcontroller registers, I2C addresses, and SPI commands are all read and written in hex.

Cryptography

Hash values, encryption keys, and digital certificates are expressed as long hexadecimal strings.

Mental Math Tips

1 hex digit = 4 bits

Each hexadecimal character (0–F) represents exactly 4 binary bits, so 2 hex chars = 1 byte (8 bits).

0xFF = 255, 0xF = 15

Memorise key hex values: 0xF=15, 0xFF=255, 0xFFF=4095, 0xFFFF=65535 — essential for masks.

Powers of 2: 1,2,4,8…256

Binary position values double each step: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024…

Frequently Asked Questions — Number Systems

Binary is a base-2 number system using only digits 0 and 1. It is the foundation of all digital computing — every piece of data in a computer is ultimately stored as binary bits.
Repeatedly divide the decimal number by 2 and record the remainders. Read the remainders from bottom to top. For example: 13 ÷ 2 = 6 R1, 6 ÷ 2 = 3 R0, 3 ÷ 2 = 1 R1, 1 ÷ 2 = 0 R1 → 1101 in binary.
Hexadecimal (base 16) is widely used in programming and computer science. It compactly represents binary data, with each hex digit representing exactly 4 bits. Common uses: memory addresses, colour codes (#FF5733), byte values in protocols, and machine code.
HTML/CSS hex colours are #RRGGBB where each pair is a hex value 00–FF for red, green and blue. #FF0000 = pure red (255,0,0), #FFFFFF = white (255,255,255), #000000 = black (0,0,0).
Decimal (base 10) uses digits 0–9 and is the everyday counting system. Octal (base 8) uses digits 0–7 and is used in Unix file permissions (chmod 755 = rwxr-xr-x) and some legacy systems.
Decimal is called base 10 because each position represents a power of 10, and there are 10 possible digit values (0–9). For example 345 = 3×10² + 4×10¹ + 5×10⁰.
Two\u2019s complement is the standard method computers use to represent negative integers in binary. To negate a number: invert all bits (one\u2019s complement) then add 1. For example, -5 in 8-bit two\u2019s complement is 11111011.