Number System Converter

Convert numbers between binary, octal, decimal, and hexadecimal instantly with grouped display.

Number System Converter

Quick values (decimal):

How to Use

1

Enter a number in any base

Type in Binary, Octal, Decimal, or Hexadecimal — all other fields update instantly.

2

View all four representations

See the number expressed in all four bases simultaneously with grouped formatting for readability.

3

Check bit grouping for binary values

Read binary output in nibble (4-bit) groups and hex in byte-aligned pairs.

4

Apply results to programming tasks

Use hex for memory addresses, binary for bit manipulation, and octal for Unix permissions.

Number Systems Explained

Computers process data in binary (base 2). Octal (base 8) and hexadecimal (base 16) are shorthand notations for binary. Hexadecimal is widely used in programming, HTML colors, memory addresses, and network protocols.

Real-World Examples & Use Cases

Bitwise Operations and Flags in Programming

Developers writing low-level code, embedded systems, and network protocols work with bitmasks and bit flags. Checking whether a permission flag is set: if (permissions & 0b00000100) uses binary literals. Setting a flag: config |= 0x08 uses hex. A number system converter helps developers move between the decimal value in business logic and the binary/hex representations in code, verifying that a decimal permission number like 52 corresponds to the intended bit pattern 00110100 with the right flags set.

Unix File Permissions (chmod)

Unix file permissions are commonly specified in octal notation. chmod 755 sets owner=read/write/execute (7=111), group=read/execute (5=101), other=read/execute (5=101). Understanding that octal 7 = binary 111 (all three permission bits set) and octal 0 = binary 000 (no permissions) requires number base conversion. A converter showing that decimal 493 = octal 755 = binary 111 101 101 makes the three-permission-group structure of Unix permissions visually clear.

Memory Addresses and Debugging

Debuggers, disassemblers, and memory inspection tools express addresses in hexadecimal (0x7FFF5FBE0000). Assembly language references registers and offsets in hex. When examining a memory dump or stack trace with addresses like 0x1A3F, a number system converter shows the decimal (6719) and binary (0001 1010 0011 1111) equivalents. For alignment calculations (is this address 16-byte aligned?), checking that the last 4 binary bits are all 0 is easier than checking divisibility by 16 in decimal.

Computer Science Education and Coursework

Computer science courses on digital logic, computer architecture, and assembly language require fluency in number base conversion. Students converting binary to hex for machine code representation, or decimal to binary for two's complement practice, use a converter to check homework answers. Teachers demonstrating base conversions — showing that 0xFF = 255 = 11111111 and that 0x100 = 256 = 1 0000 0000 — use live converters during lectures to make the relationships immediate and interactive.

How It Works

Number Base Conversion Algorithms: Decimal to Binary: Repeatedly divide by 2, collect remainders (right to left): 13 ÷ 2 = 6 R1 → bit 0 = 1 6 ÷ 2 = 3 R0 → bit 1 = 0 3 ÷ 2 = 1 R1 → bit 2 = 1 1 ÷ 2 = 0 R1 → bit 3 = 1 Result: 1101 (read remainders bottom to top) JavaScript: (13).toString(2) = "1101" Decimal to Hex: Same algorithm but divide by 16: 255 ÷ 16 = 15 R15 (F) → digit 0 = F 15 ÷ 16 = 0 R15 (F) → digit 1 = F Result: FF (= 255) JavaScript: (255).toString(16).toUpperCase() = "FF" Decimal to Octal: Divide by 8: 255 ÷ 8 = 31 R7 → digit 0 = 7 31 ÷ 8 = 3 R7 → digit 1 = 7 3 ÷ 8 = 0 R3 → digit 2 = 3 Result: 377 (octal) = 255 (decimal) JavaScript: (255).toString(8) = "377" Binary to Hex (shortcut): Group binary into nibbles (4 bits), convert each to hex digit: 1111 0000 → F0 1010 0011 → A3 (4 binary digits always = 1 hex digit) Any base to decimal: sum(digit[i] × base^position) from right Binary 1101: 1×2³ + 1×2² + 0×2¹ + 1×2⁰ = 8+4+0+1 = 13 Hex 1A: 1×16¹ + 10×16⁰ = 16+10 = 26

Frequently Asked Questions

Why do computers use binary and not decimal?
Digital circuits are implemented as transistors that exist in one of two reliable states: ON (allowing current) or OFF (blocking current), representing 1 and 0. Trying to represent 10 distinct voltage levels for decimal digits would require extremely precise analog circuitry that's unreliable at the billions-of-operations-per-second speed of modern processors. Binary is physically simple: any voltage above a threshold is 1, below it is 0. Two levels are robust, fast, and easy to manufacture. All other number systems (octal, hex) are just human-readable shorthand for binary.
What is the relationship between binary and hexadecimal?
Hexadecimal (hex) is shorthand for binary: every hex digit corresponds to exactly 4 binary digits (bits). This alignment makes conversion trivial: 0x3A = 0011 1010 in binary (3=0011, A=1010). You can verify by memorizing just 16 nibbles: 0–9 = 0000–1001, A=1010, B=1011, C=1100, D=1101, E=1110, F=1111. Programmers write 0xFF instead of 11111111 because it's compact. A byte is always 2 hex digits (00–FF). Memory addresses expressed in hex immediately reveal byte-boundary alignment.
What are octal numbers used for today?
Octal (base 8) was historically used in early computing because 6-bit and 12-bit computer architectures divided evenly into 3-bit groups (one octal digit = 3 bits). Today, octal's primary remaining use is Unix/Linux file permissions: chmod 755, chmod 644, chmod 777. The three-digit octal number perfectly represents the three permission groups (owner, group, other), each with three possible permission bits (read, write, execute). Beyond file permissions, octal has been largely replaced by hexadecimal in modern computing contexts.
How do I convert a hex color code to RGB?
A CSS color like #FF5733 splits into three hex pairs: FF (red), 57 (green), 33 (blue). Convert each pair to decimal: FF=255, 57=87, 33=51. Result: rgb(255, 87, 51). The number system converter converts hex FF=255 for you. Reversing: rgb(255, 87, 51) → convert each to hex: 255=FF, 87=57, 51=33 → #FF5733. Shorthand #RGB is expanded: #F53 = #FF5533. Modern CSS accepts both hex and rgb() notation, and the conversions are all based on the hex ↔ decimal conversion this tool performs.
What is two's complement and how does binary represent negative numbers?
Integers in computers use two's complement representation for negative numbers. To negate a binary number: flip all bits (NOT), then add 1. Example (8-bit): 5 = 00000101. Flip: 11111010. Add 1: 11111011 = -5. This system makes binary addition work correctly for both positive and negative numbers without special handling. The most significant bit (leftmost) indicates sign: 0 = positive, 1 = negative. Maximum 8-bit signed range: -128 to +127. Two's complement explains why simply putting a minus sign before binary digits doesn't correctly represent negative integers in computer hardware.

Related Tools

Explore other tools in this category.

Looking for something else?