Blucalculator Open Tool

Number System Converter

Type in any field — all others update instantly.

Supports unsigned integers up to 2⁵³ (JavaScript safe integer limit).

Embed This Calculator

Copy the code and paste it into any webpage to embed this calculator.

WordPress users: add a Custom HTML block (not the Embed block) and paste the code there.

More embed options

Free to use. A small "Powered by Blucalculator" credit is appreciated but not required.

Quick Reference

Dec Bin Oct Hex
0 0000 0 0
1 0001 1 1
2 0010 2 2
3 0011 3 3
4 0100 4 4
5 0101 5 5
6 0110 6 6
7 0111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 a
11 1011 13 b
12 1100 14 c
13 1101 15 d
14 1110 16 e
15 1111 17 f

How to use this calculator

Four input fields. Type in any one of them. All others update instantly.

Decimal (base 10) — The number system you use every day. Digits 0–9. Enter any positive integer here and the other three fields populate immediately. This is the most common starting point.

Binary (base 2) — Only digits 0 and 1. The native language of every digital computer. Enter a binary string and the converter shows you the decimal, octal, and hex equivalents. Spaces are ignored — you can type 1111 1111 or 11111111 and get the same result.

Octal (base 8) — Digits 0–7. Less common than the other three but still used in Unix/Linux file permissions and some legacy systems. Enter an octal number to see the equivalent in all other bases.

Hexadecimal (base 16) — Digits 0–9 and letters A–F (or a–f). Hex is everywhere in computing: memory addresses, colour codes, byte representations, debug output. Enter a hex value with or without the 0x prefix.

The result panel below the inputs shows the decimal value prominently, with binary, octal, and hex all displayed together. The bit representation section groups the binary value into nibbles (4-bit groups), shows the total bit count, and tells you how many bytes the value occupies.

The converter supports unsigned integers up to 2⁵³ (JavaScript’s safe integer limit: 9,007,199,254,740,992).

Quick example — the number 255

Decimal: 255 Binary: 11111111 Octal: 377 Hex: FF (shown as 0xFF)

Bit representation: [1][1][1][1] [1][1][1][1] — 8 bits, 1 byte

255 is a special number in computing. It’s the maximum value of an unsigned 8-bit integer, which is why it appears constantly in networking (255.255.255.255 is the IPv4 broadcast address), colour values (RGB channels run 0–255), and byte masks.

The quick reference table below the calculator shows decimal 0–15 with their binary, octal, and hex equivalents. This range (0–F in hex) is a nibble — 4 bits. Memorising 0–15 in hex is genuinely useful for reading hex dumps, colour codes, and memory addresses without needing a converter.


Why four number systems exist in computing

Humans count in base 10 because we have 10 fingers. Computers operate in base 2 because transistors have two states: on and off, 1 and 0. That’s the foundation of everything digital.

Binary works, but reading it is tedious. A 32-bit memory address in binary is 32 ones and zeros with no obvious structure. Hexadecimal solves this by grouping 4 binary digits into a single hex digit. 4 bits = 1 hex digit, so an 8-bit byte becomes 2 hex digits. A 32-bit address becomes 8 hex characters. Suddenly 0xFFAB1234 is readable where 11111111101010110001001000110100 is not.

Octal was popular in older computing systems (6-bit and 12-bit architectures) and survived mainly in Unix file permissions, where three octal digits represent read/write/execute permissions for owner, group, and other. chmod 755 is three octal digits: 7 (rwx), 5 (r-x), 5 (r-x).

The four bases together cover every representation you’ll encounter in modern computing.

Each number system is just a different way of grouping powers of a base. Decimal groups by powers of 10. Binary by powers of 2. Octal by powers of 8. Hex by powers of 16. The value doesn't change, only the notation.

The conversion formulas

Decimal to binary

Repeatedly divide by 2, record the remainder at each step, then read the remainders from bottom to top.

Decimal to binary: divide by 2 repeatedly, remainders from last to first = binary digits

Convert 13 to binary

13 ÷ 2 = 6 remainder 1 6 ÷ 2 = 3 remainder 0 3 ÷ 2 = 1 remainder 1 1 ÷ 2 = 0 remainder 1

Read remainders bottom to top: 1101

Check: 1×8 + 1×4 + 0×2 + 1×1 = 8 + 4 + 0 + 1 = 13. Correct.

Binary to decimal

Multiply each binary digit by its positional power of 2, sum the results.

Binary to decimal: sum of (each bit × 2^position), counting from right starting at position 0

Convert 11010 to decimal

1×2⁴ + 1×2³ + 0×2² + 1×2¹ + 0×2⁰ = 16 + 8 + 0 + 2 + 0 = 26

Decimal to hexadecimal

Same process as decimal to binary, but divide by 16. Remainders above 9 become A (10), B (11), C (12), D (13), E (14), F (15).

Decimal to hex: divide by 16 repeatedly, map remainders 10–15 to A–F, read bottom to top

Convert 255 to hex

255 ÷ 16 = 15 remainder 15 = F 15 ÷ 16 = 0 remainder 15 = F

Read bottom to top: FF

Binary to hexadecimal (the fast way)

Group binary digits into 4-bit nibbles from the right. Convert each nibble to its hex digit directly. No division needed.

Binary to hex: split into 4-bit groups from right, convert each group to one hex digit

Convert 11111010 to hex

Split: 1111 | 1010

1111 = 15 = F 1010 = 10 = A

Result: FA

This is why hex is the standard companion to binary in computing. One hex digit always represents exactly 4 binary bits. The grouping is clean and reversible in your head with practice.

Decimal to octal

Divide by 8 repeatedly. Remainders are always 0–7 (octal digits only). Read bottom to top.

Decimal to octal: divide by 8 repeatedly, read remainders bottom to top

Convert 255 to octal

255 ÷ 8 = 31 remainder 7 31 ÷ 8 = 3 remainder 7 3 ÷ 8 = 0 remainder 3

Read bottom to top: 377

Hex to binary (also fast)

Each hex digit expands directly to exactly 4 binary bits. No math needed beyond memorising the 16 nibble values.

Hex to binary: expand each hex digit to its 4-bit binary equivalent

Convert 0xAF to binary

A = 1010 F = 1111

Result: 10101111


Quick reference: decimal 0–16 in all four bases

DecimalBinaryOctalHex
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F
16100002010

Notice how 16 in hex is written as “10” — just like how decimal 10 means one group of ten. In hex, “10” means one group of sixteen. The carry happens at a different threshold, but the logic is identical.


Bit representation: what the nibble display shows

The bit display groups binary digits into 4-bit nibbles visually. A nibble is the smallest named grouping above a single bit. Two nibbles = 1 byte (8 bits). The display tells you:

Total bit count — The minimum number of bits needed to represent the value. 255 takes 8 bits. 256 takes 9 bits (the 9th bit trips over when you exceed 11111111).

Byte count — Total bits divided by 8, rounded up. Relevant for understanding memory footprint, data type sizing, and network packet fields.

Common bit groupings and their ranges:

NameBitsUnsigned rangeHex digitsUsed in
Nibble40–151BCD, compression
Byte80–2552ASCII, RGB channels, IP octets
Word160–65,5354Unicode (BMP), port numbers
Double word320–4,294,967,2958IPv4 addresses, uint32
Quad word640–18,446,744,073,709,551,61516uint64, timestamps

The reason colour values run 0–255 per channel is that one colour channel fits exactly in one byte. Three channels (RGB) fit in 3 bytes = 6 hex digits, which is why a web colour like #FF5733 is 6 characters: FF (red), 57 (green), 33 (blue).


Where each number system actually appears

Binary in practice

Every boolean value in code is a single bit: true = 1, false = 0. Bitwise operations (AND, OR, XOR, NOT, bit shifting) work directly on binary representations. Subnet masks in networking are often explained in binary: 255.255.255.0 = 11111111.11111111.11111111.00000000.

Bitwise AND in networking

IP address: 192.168.1.100 = 11000000.10101000.00000001.01100100 Subnet mask: 255.255.255.0 = 11111111.11111111.11111111.00000000

AND result: 11000000.10101000.00000001.00000000 = 192.168.1.0

That’s the network address. Bitwise AND with the subnet mask isolates which part of the IP address identifies the network.

Hexadecimal in practice

Memory addresses: 0x00007FFF5FBFF8A8 — a 64-bit stack address from a macOS process.

RGB colours: #1E90FF = R:30, G:144, B:255 = dodger blue.

SHA-256 hash: a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e — 64 hex characters = 256 bits = a SHA-256 hash of the word “Hello”.

MAC addresses: 00:1A:2B:3C:4D:5E — 6 bytes written as 6 hex pairs, the hardware address of every network interface.

Octal in Unix permissions

chmod 755 translates directly:

7 in octal = 111 in binary = read(4) + write(2) + execute(1) = rwx (owner) 5 in octal = 101 in binary = read(4) + write(0) + execute(1) = r-x (group) 5 in octal = 101 in binary = read(4) + write(0) + execute(1) = r-x (others)

So chmod 755 gives the owner full permissions and everyone else read+execute.

chmod 644 = 110|100|100 = rw-|r—|r— (owner read/write, others read-only)

Power of 2 boundaries

The values 128, 256, 512, 1024, 2048, 4096… are all powers of 2. They appear constantly in computing because they represent the exact capacity of n-bit systems.

255 = 2⁸ - 1 (max unsigned byte) 65,535 = 2¹⁶ - 1 (max unsigned 16-bit integer) 4,294,967,295 = 2³² - 1 (max unsigned 32-bit integer)


Real-world examples

Web colour to RGB

A designer sees #3B82F6 in a stylesheet and wants the RGB values.

Split into three hex pairs: 3B | 82 | F6

3B hex: 3×16 + 11 = 48 + 11 = 59 (red) 82 hex: 8×16 + 2 = 128 + 2 = 130 (green) F6 hex: 15×16 + 6 = 240 + 6 = 246 (blue)

RGB(59, 130, 246) — this is Tailwind CSS’s blue-500 colour.

Reading a memory dump

A developer is debugging a program and sees this hex dump:

48 65 6C 6C 6F 20 57 6F 72 6C 64

Each hex pair is one byte. Converting to decimal then to ASCII:

48 = 72 = ‘H’ 65 = 101 = ‘e’ 6C = 108 = ‘l’ 6C = 108 = ‘l’ 6F = 111 = ‘o’ 20 = 32 = ’ ’ 57 = 87 = ‘W’ 6F = 111 = ‘o’ 72 = 114 = ‘r’ 6C = 108 = ‘l’ 64 = 100 = ‘d’

The memory dump contains the string: “Hello World”

IPv4 subnet calculation

Network admin sees subnet 10.0.0.0/8. What’s the broadcast address?

/8 means the first 8 bits are the network portion. The remaining 24 bits are all set to 1 for the broadcast address.

Network: 00001010.00000000.00000000.00000000 = 10.0.0.0 Broadcast: 00001010.11111111.11111111.11111111

Last 24 bits all 1s = three bytes of 11111111 = three bytes of 255.

Broadcast address: 10.255.255.255

The converter confirms: 11111111 in binary = 255 in decimal = FF in hex.

Checking a file’s magic bytes

Every file format has a “magic number” — a specific sequence of bytes at the start of the file that identifies its type. In hex:

PDF files start with: 25 50 44 46 in hex

25 = 37 = ’%’ 50 = 80 = ‘P’ 44 = 68 = ‘D’ 46 = 70 = ‘F’

So a PDF file begins with the ASCII text “%PDF”. That’s how file format detection works — not from the extension, but from the actual bytes.

PNG files start with: 89 50 4E 47 0D 0A 1A 0A

89 is non-ASCII (intentionally, to catch encoding issues) 50 4E 47 = ‘P’, ‘N’, ‘G’


Common mistakes

Confusing octal 8 and 9 with decimal. Octal only uses digits 0–7. The number 8 doesn’t exist in octal. If you type 8 or 9 into an octal field, the converter should flag it as invalid. Octal 10 = decimal 8. Octal 11 = decimal 9.

Mixing up hex letter case. A and a both mean 10. FF and ff both mean 255. The converter accepts both. But when comparing values manually — like checking a SHA hash — case differences can cause you to think two identical values differ. Standardise on one case (uppercase for addresses, lowercase for hashes is common).

Forgetting the 0x prefix context. FF as a hex value is 255. Without context, FF could look like two letters. The 0x prefix (0xFF) signals hexadecimal in most programming languages. When writing hex values by hand in code, always include 0x to avoid ambiguity.

Off-by-one in bit counting. The largest value representable in 8 bits is 11111111 = 255, not 256. 256 requires 9 bits (100000000). n bits can represent values from 0 to 2ⁿ - 1. The converter’s bit count display shows the minimum bits needed, which makes this explicit.

Reading binary left to right when converting manually. The least significant bit (rightmost) is position 0 with value 2⁰ = 1. The most significant bit (leftmost) is the highest power. When doing the divide-by-2 method, you read remainders from bottom to top specifically because the first remainder is the least significant bit.

Be careful with signed vs unsigned integers. The converter works with unsigned values (all positive). In computing, signed 8-bit integers use two’s complement: the bit pattern 11111111 that represents 255 unsigned represents -1 signed. A hex value of 0xFF is 255 in unsigned 8-bit and -1 in signed 8-bit. The difference matters in every low-level context: C/C++, assembly, network protocol parsing, and binary file format work.


The bottom line

Decimal, binary, octal, and hexadecimal are four ways of writing the same numbers. The converter handles all four simultaneously so you never have to choose which direction to calculate. Type in any field, get all three others instantly.

Binary is the computer’s native representation. Hex is the human-readable shorthand for binary. Octal survives in Unix permissions. Decimal is how the rest of the world communicates numbers.

The bit display at the bottom is the part that actually connects abstract notation to physical reality: it shows you how many transistors (bits) it takes to store the value you typed. 255 takes 8. 256 takes 9. Everything in digital computing comes down to that binary representation at some level, regardless of what notation sits on top of it.

Frequently Asked Questions

How do I convert decimal to binary?

Repeatedly divide by 2 and record remainders from bottom to top. Example: 13 ÷ 2 = 6 R1, 6 ÷ 2 = 3 R0, 3 ÷ 2 = 1 R1, 1 ÷ 2 = 0 R1 → binary = 1101.

How do I convert hex to decimal?

Multiply each digit by 16 raised to its position. FF = 15×16 + 15 = 255. Hex digits A–F represent 10–15.

What is octal used for?

Octal (base 8) is used in Unix/Linux file permissions. chmod 755 = owner 7 (rwx), group 5 (r-x), others 5 (r-x). Each octal digit maps to 3 binary bits.

Why do programmers use hexadecimal?

Each hex digit represents exactly 4 binary bits. A byte = 2 hex digits (0x00–0xFF), making memory addresses and machine code far more readable than binary.

What is 0xFF in decimal?

0xFF = 255. It is the maximum value of one unsigned byte (8 bits all 1s: 11111111). Used in color codes: white = #FFFFFF.

What does the 0x prefix mean?

0x indicates hexadecimal in C, C++, Java, Python, JavaScript. 0b indicates binary; 0o indicates octal (Python). Example: 0xFF = 255 decimal.

What is the largest value for 8, 16, and 32-bit integers?

Unsigned: 8-bit = 255 (0xFF), 16-bit = 65,535 (0xFFFF), 32-bit = 4,294,967,295 (0xFFFFFFFF). Signed (two's complement): 8-bit = 127 max / -128 min, 16-bit = 32,767 max, 32-bit = 2,147,483,647 max.

How is a byte split into nibbles?

A byte (8 bits) is split into two nibbles of 4 bits each. The upper nibble is the left hex digit; the lower nibble is the right. Example: 0xAB → upper nibble A = 1010, lower nibble B = 1011.