Converter

Hex/decimal/octal/binary Converter

Hex/decimal/octal/binary Converter

🔢 Number System Converter

Hex ⇄ Decimal ⇄ Octal ⇄ Binary Converter | Multi-Base Calculator

Digits 0-9 (e.g., 255)
Digits 0-9, A-F (e.g., FF)
Digits 0-7 (e.g., 377)
Digits 0-1 (e.g., 11111111)
✓ Conversion Results:

🔄 Common Number System Conversions (0-16)

Decimal (10)Hex (16)Octal (8)Binary (2)
0000
1111
22210
33311
444100
555101
666110
777111
88101000
99111001
10A121010
11B131011
12C141100
13D151101
14E161110
15F171111
16102010000

📚 Complete Guide to Number System Conversion

Understanding Number Systems

Number systems (numeral systems) are mathematical notations for representing numbers using digits or symbols. Different bases provide distinct advantages for various computing and mathematical applications. Decimal (Base-10): The standard human counting system using ten digits (0-9). Each position represents a power of 10: ones \( (10^0) \), tens \( (10^1) \), hundreds \( (10^2) \), thousands \( (10^3) \). Example: 345 = \( 3 \times 10^2 + 4 \times 10^1 + 5 \times 10^0 = 300 + 40 + 5 \). Natural for humans due to ten fingers. Used universally for everyday mathematics, commerce, science, and communication. Binary (Base-2): Uses only two digits (0, 1). Each position represents a power of 2: \( 2^0=1, 2^1=2, 2^2=4, 2^3=8, 2^4=16, 2^5=32, 2^6=64, 2^7=128, 2^8=256 \). Example: 1011₂ = \( 1 \times 8 + 0 \times 4 + 1 \times 2 + 1 \times 1 = 11₁₀ \). Foundation of all digital computing—electronic circuits naturally implement two states (on/off, high/low voltage). Every computer operation ultimately reduces to binary. Octal (Base-8): Uses eight digits (0-7). Each position represents power of 8: \( 8^0=1, 8^1=8, 8^2=64, 8^3=512 \). Example: 157₈ = \( 1 \times 64 + 5 \times 8 + 7 \times 1 = 111₁₀ \). Each octal digit corresponds to exactly 3 binary bits (0₈=000₂ through 7₈=111₂). Historically popular in early computing (1960s-70s) for compact binary representation. Modern usage: Unix file permissions (chmod 755), aviation transponder codes. Hexadecimal (Base-16): Uses sixteen symbols: digits 0-9 and letters A-F (A=10, B=11, C=12, D=13, E=14, F=15). Each position represents power of 16: \( 16^0=1, 16^1=16, 16^2=256, 16^3=4096 \). Example: 1A3₁₆ = \( 1 \times 256 + 10 \times 16 + 3 \times 1 = 419₁₀ \). Each hex digit equals exactly 4 binary bits (0₁₆=0000₂ through F₁₆=1111₂). Perfect for modern computing: 8-bit byte = 2 hex digits (00-FF = 0-255). Ubiquitous in programming: memory addresses (0x7FFF), RGB colors (#FF5733), MAC addresses (00:1A:2B:3C:4D:5E), checksums, debugging.

Number System Comparison Table

SystemBaseDigits/SymbolsPosition ValuesPrimary Uses
Decimal100-9 (10 digits)1, 10, 100, 1000...Everyday arithmetic, commerce, science, human communication
Binary20, 1 (2 digits)1, 2, 4, 8, 16, 32, 64, 128...Digital logic, computer hardware, CPU operations, data storage
Octal80-7 (8 digits)1, 8, 64, 512...Unix permissions, legacy systems, 3-bit grouping
Hexadecimal160-9, A-F (16 symbols)1, 16, 256, 4096...Memory addresses, colors, MAC addresses, debugging, checksums

Decimal to Other Bases Conversion

Division-Remainder Method (Decimal to Binary/Octal/Hex): Repeatedly divide by target base, recording remainders. Read remainders bottom-to-top for result. Decimal to Binary (base-2): Example: Convert 13₁₀ to binary. 13÷2 = 6 r1; 6÷2 = 3 r0; 3÷2 = 1 r1; 1÷2 = 0 r1. Remainders bottom-up: 1101₂. Verify: \( 1 \times 8 + 1 \times 4 + 0 \times 2 + 1 \times 1 = 13₁₀ \) ✓. Decimal to Octal (base-8): Example: Convert 100₁₀ to octal. 100÷8 = 12 r4; 12÷8 = 1 r4; 1÷8 = 0 r1. Result: 144₈. Verify: \( 1 \times 64 + 4 \times 8 + 4 \times 1 = 100₁₀ \) ✓. Decimal to Hexadecimal (base-16): Example: Convert 255₁₀ to hex. 255÷16 = 15 r15(F); 15÷16 = 0 r15(F). Result: FF₁₆. Verify: \( 15 \times 16 + 15 \times 1 = 255₁₀ \) ✓. Note: Remainders 10-15 convert to A-F in hex. Another example: 419₁₀. 419÷16 = 26 r3; 26÷16 = 1 r10(A); 1÷16 = 0 r1. Result: 1A3₁₆. Why this method works: Division extracts digits from right to left. Remainder represents value in that position. Quotient becomes next iteration's input until quotient reaches 0.

Binary/Octal/Hex to Decimal Conversion

Positional Multiplication Method: Multiply each digit by its positional power, sum all products. Binary to Decimal: Example: 1010₂ to decimal. Positions (right-to-left): \( 2^3, 2^2, 2^1, 2^0 = 8, 4, 2, 1 \). Binary: 1 0 1 0. Calculation: \( 1 \times 8 + 0 \times 4 + 1 \times 2 + 0 \times 1 = 8 + 0 + 2 + 0 = 10₁₀ \). Octal to Decimal: Example: 377₈ to decimal. Positions: \( 8^2, 8^1, 8^0 = 64, 8, 1 \). Calculation: \( 3 \times 64 + 7 \times 8 + 7 \times 1 = 192 + 56 + 7 = 255₁₀ \). Hex to Decimal: Example: 1A3₁₆ to decimal. Positions: \( 16^2, 16^1, 16^0 = 256, 16, 1 \). Digits: 1, A(10), 3. Calculation: \( 1 \times 256 + 10 \times 16 + 3 \times 1 = 256 + 160 + 3 = 419₁₀ \). Another example: FF₁₆. Calculation: \( 15 \times 16 + 15 \times 1 = 240 + 15 = 255₁₀ \).

Direct Binary ↔ Hex ↔ Octal Conversion

Binary to Hexadecimal (4-bit grouping): Each hex digit = 4 binary bits. Group binary from right in sets of 4, convert each group. Example: 11010101₂ to hex. Group: 1101 | 0101. Convert: 1101₂=D₁₆, 0101₂=5₁₆. Result: D5₁₆. Example: 11111111₂. Group: 1111 | 1111. Convert: F₁₆, F₁₆. Result: FF₁₆ (255₁₀). Hexadecimal to Binary: Replace each hex digit with 4-bit binary equivalent. Example: 1A3₁₆ to binary. 1₁₆=0001₂, A₁₆=1010₂, 3₁₆=0011₂. Result: 000110100011₂ = 110100011₂ (drop leading zeros). Binary to Octal (3-bit grouping): Each octal digit = 3 binary bits. Group binary from right in sets of 3. Example: 11010101₂ to octal. Group: 011 | 010 | 101 (pad left). Convert: 011₂=3₈, 010₂=2₈, 101₂=5₈. Result: 325₈. Octal to Binary: Replace each octal digit with 3-bit binary. Example: 377₈ to binary. 3₈=011₂, 7₈=111₂, 7₈=111₂. Result: 011111111₂ = 11111111₂. Hex to Octal (via binary intermediate): Convert hex→binary→octal. Example: FF₁₆. FF₁₆ = 11111111₂ (8 bits). Group by 3: 011 111 111. Result: 377₈. Shortcut: Can convert hex→decimal→octal, but binary path often faster for visualization.

Practical Applications Across Computing

Memory Addresses and Pointers: Computer memory addresses expressed in hexadecimal for compact representation. 32-bit address: 0x7FFFFFFF (max signed int). 64-bit address: 0x00007FFFFFFFFFFF. Pointer debugging: Examine memory location 0x004A2B18 in hex dump. Assembly language uses hex for instruction addresses: JMP 0x1234 (jump to address). RGB Color Representation: Web colors use 6-digit hex: #RRGGBB. Each pair = 1 byte (00-FF = 0-255). White: #FFFFFF = RGB(255,255,255). Black: #000000 = RGB(0,0,0). Red: #FF0000. Green: #00FF00. Blue: #0000FF. Custom: #3A7BD5 = RGB(58,123,213) = (58₁₀, 123₁₀, 213₁₀). CSS accepts hex colors: background-color: #2E8B57. Unix File Permissions (Octal): chmod 755 = rwxr-xr-x. 7₈=111₂=rwx (owner), 5₈=101₂=r-x (group), 5₈=101₂=r-x (others). chmod 644 = rw-r--r-- (standard file). chmod 777 = rwxrwxrwx (full access, insecure). Each octal digit encodes 3 permission bits (read=4, write=2, execute=1). Network MAC Addresses: 48-bit address written as 6 hex bytes: 00:1A:2B:3C:4D:5E. First 3 bytes (00:1A:2B) = OUI (manufacturer). Last 3 bytes (3C:4D:5E) = device-specific. Example: Apple device 00:17:F2:xx:xx:xx. IPv6 Addresses: 128-bit address written as 8 groups of 4 hex digits: 2001:0db8:85a3:0000:0000:8a2e:0370:7334. Shortened: 2001:db8:85a3::8a2e:370:7334 (consecutive zeros compressed). Character Encoding: ASCII code in hex: 'A'=0x41 (65₁₀), 'a'=0x61 (97₁₀). Unicode: Euro symbol €=0x20AC. URL encoding: space=%20 (hex 20). Binary Flags and Bitwise Operations: Permission bits: 0b1011 = read+write+execute. Bitwise OR: 0101 | 0011 = 0111. Bitwise AND: 1100 & 1010 = 1000. Used in graphics (pixel operations), encryption, compression. File Formats and Magic Numbers: PNG file starts: 89 50 4E 47 (hex) = .PNG header. JPEG: FF D8 FF. ZIP: 50 4B 03 04. File signature identification uses hex patterns.

Why Choose RevisionTown's Number System Converter?

RevisionTown's professional converter provides: (1) Simultaneous Multi-Base Conversion—Enter value in any base, instantly see all four representations (decimal, hex, octal, binary); (2) Real-Time Validation—Automatic input validation ensures only valid digits for each base (0-9 for decimal, 0-F for hex, 0-7 for octal, 0-1 for binary); (3) Bidirectional Conversion—Convert in any direction: dec↔hex↔oct↔bin without separate tools; (4) Large Number Support—Handles values up to JavaScript safe integer limit (2⁵³-1) for comprehensive applications; (5) Uppercase/Lowercase Hex—Accepts both FF and ff input formats; (6) Comprehensive Reference Table—Quick lookup for common values 0-16 showing all four base representations; (7) Mobile Optimized—Responsive design works perfectly on smartphones, tablets, and desktops for on-the-go calculations; (8) Zero Cost—Completely free with no ads, registration, or limitations; (9) Professional Accuracy—Trusted by computer science students, programmers, system administrators, digital electronics engineers, network engineers, cybersecurity professionals, and IT specialists worldwide for homework assignments (converting decimal 255 to FF hex, 377 octal, 11111111 binary), programming (converting hex color #FF5733 to RGB decimal values 255,87,51), system administration (understanding chmod 755 permissions = rwxr-xr-x = 111 101 101 binary), network engineering (converting IP octets, MAC addresses between hex and decimal), embedded systems (register values between hex and binary for hardware programming), debugging (interpreting memory dumps, stack traces with hex addresses), web development (color codes between hex #3A7BD5 and RGB decimal 58,123,213), digital circuit design (binary logic gate inputs/outputs, truth tables), cryptography (key representations in hex, binary analysis), data analysis (hexadecimal data parsing, binary flag interpretation), reverse engineering (analyzing binary executables, hex editors), and all applications requiring accurate multi-base number system conversions with instant results for professional computer science, software development, IT administration, electrical engineering, and comprehensive computational mathematics worldwide.

❓ Frequently Asked Questions

How to convert decimal to hexadecimal?

Divide by 16 repeatedly, record remainders, read bottom-to-top. Steps: (1) Divide decimal by 16. (2) Record remainder (0-15; use A-F for 10-15). (3) Divide quotient by 16. (4) Repeat until quotient = 0. (5) Read remainders bottom-to-top. Example: 255₁₀ to hex. 255÷16 = 15 remainder 15(F). 15÷16 = 0 remainder 15(F). Remainders up: FF₁₆. Verify: F×16 + F = 15×16 + 15 = 240+15 = 255₁₀ ✓. Example: 100₁₀ to hex. 100÷16 = 6 r4; 6÷16 = 0 r6. Result: 64₁₆. Hex digits: 0-9 (same as decimal), A=10, B=11, C=12, D=13, E=14, F=15. Calculator shortcut: Most scientific calculators have DEC→HEX button. Programming: Integer.toString(16) in JavaScript; hex() in Python. Quick patterns: Powers of 16: 16₁₀=10₁₆, 256₁₀=100₁₆, 4096₁₀=1000₁₆. Common: 255₁₀=FF₁₆ (max byte); 256₁₀=100₁₆.

What is hexadecimal number system?

Hexadecimal (hex) = base-16 number system using 16 symbols: 0-9 and A-F. Digits: 0,1,2,3,4,5,6,7,8,9,A(10),B(11),C(12),D(13),E(14),F(15). Each position represents power of 16: \( 16^0=1, 16^1=16, 16^2=256, 16^3=4096 \). Example: 1A3₁₆ = \( 1×256 + 10×16 + 3×1 = 419₁₀ \). Why computers use hex: Each hex digit = exactly 4 binary bits (0₁₆=0000₂ through F₁₆=1111₂). Perfect for 8-bit bytes: 1 byte (8 bits) = 2 hex digits (00-FF = 0-255 decimal). Much more compact than binary (FF vs 11111111) yet directly corresponds. Common applications: (1) Memory addresses: 0x7FFFFFFF (32-bit), 0x00007FFF (64-bit pointer). (2) RGB colors: #FF5733 = red(255), green(87), blue(51). (3) MAC addresses: 00:1A:2B:3C:4D:5E (48 bits = 12 hex digits). (4) Checksums: MD5, SHA hashes displayed as hex strings. (5) Debugging: Stack traces, memory dumps use hex addresses. Notation: Prefix 0x (C, Java, JavaScript: 0xFF), # (colors: #00FF00), subscript ₁₆ (mathematics: 1A3₁₆). Case-insensitive: FF = ff (both valid).

How to convert binary to decimal?

Multiply each bit by its power of 2, sum all products. Formula: For binary \( b_n...b_2b_1b_0 \), decimal = \( b_n×2^n + ... + b_2×2^2 + b_1×2^1 + b_0×2^0 \). Example: 1010₂ to decimal. Positions (right-to-left): 0,1,2,3. Binary: 1 0 1 0. Powers: \( 2^3=8, 2^2=4, 2^1=2, 2^0=1 \). Calculation: \( 1×8 + 0×4 + 1×2 + 0×1 = 8+0+2+0 = 10₁₀ \). Example: 11111111₂. Eight 1-bits: \( 2^7+2^6+2^5+2^4+2^3+2^2+2^1+2^0 = 128+64+32+16+8+4+2+1 = 255₁₀ \). Shortcut: Only calculate positions with 1-bits (ignore 0-bits). 10101₂ has 1s at positions 0,2,4: \( 2^4+2^2+2^0 = 16+4+1 = 21₁₀ \). Quick reference: Memorize powers of 2: 1,2,4,8,16,32,64,128,256,512,1024 for faster mental math. Pattern: n consecutive 1-bits = \( 2^n-1 \). Four 1s (1111₂) = 15₁₀; eight 1s (11111111₂) = 255₁₀.

How to convert hex to binary?

Replace each hex digit with its 4-bit binary equivalent. Conversion table: 0=0000, 1=0001, 2=0010, 3=0011, 4=0100, 5=0101, 6=0110, 7=0111, 8=1000, 9=1001, A=1010, B=1011, C=1100, D=1101, E=1110, F=1111. Memorize these 16 patterns for instant conversion. Example 1: FF₁₆ to binary. F₁₆=1111₂, F₁₆=1111₂. Result: 11111111₂ (8 bits). Example 2: 1A3₁₆ to binary. 1₁₆=0001₂, A₁₆=1010₂, 3₁₆=0011₂. Result: 000110100011₂ = 110100011₂ (drop leading zeros). Example 3: C5₁₆ to binary. C₁₆=1100₂, 5₁₆=0101₂. Result: 11000101₂. Why this works: Each hex digit represents exactly 4 binary bits (16 = 2⁴). This direct mapping makes hex perfect for visualizing binary data compactly. Reverse (binary→hex): Group binary by 4 from right, convert each group. 11010101₂: Group 1101|0101 = D₁₆,5₁₆ = D5₁₆. Use cases: Memory dumps (hex editor shows hex, need binary interpretation); bit manipulation (convert hex flags to binary for individual bit analysis); color codes (#FF00FF to binary RGB values).

What is the difference between binary and hexadecimal?

Binary (base-2) uses 2 digits (0,1); Hexadecimal (base-16) uses 16 symbols (0-9,A-F). Both represent same values, different notation. Key differences: (1) Compactness: Binary: 255₁₀ = 11111111₂ (8 digits). Hex: 255₁₀ = FF₁₆ (2 digits). Hex 4× more compact—easier to read/write. (2) Human readability: Binary long, error-prone for humans (00101101 vs 01011101 easily confused). Hex shorter, distinct digits (2D vs 5D clearly different). (3) Direct correspondence: Each hex digit = exactly 4 binary bits. Conversion trivial: F₁₆=1111₂ instantly without calculation. (4) Applications: Binary: Hardware level (CPU logic, transistors, digital circuits, low-level debugging). Hex: Human interface to binary (memory addresses, colors, debugging tools, programming). Example comparison: 8-bit value: Binary 10101100₂ (8 digits, hard to parse). Hex AC₁₆ (2 digits, easy to remember). Decimal 172₁₀ (3 digits, but no direct binary mapping). When to use: Use binary when analyzing individual bits (flags, permissions, bitwise operations). Use hex when representing multi-bit values compactly (addresses, colors, data dumps). Both represent identical information—hex is compressed binary notation for human convenience.

How to convert octal to decimal?

Multiply each octal digit by its power of 8, sum products. Formula: For octal \( o_n...o_2o_1o_0 \), decimal = \( o_n×8^n + ... + o_2×8^2 + o_1×8^1 + o_0×8^0 \). Example: 377₈ to decimal. Positions (right-to-left): 0,1,2. Octal: 3 7 7. Powers: \( 8^2=64, 8^1=8, 8^0=1 \). Calculation: \( 3×64 + 7×8 + 7×1 = 192+56+7 = 255₁₀ \). Example: 144₈ to decimal. Calculation: \( 1×64 + 4×8 + 4×1 = 64+32+4 = 100₁₀ \). Example: 12₈ to decimal. Calculation: \( 1×8 + 2×1 = 8+2 = 10₁₀ \). Shortcut: Memorize powers: \( 8^0=1, 8^1=8, 8^2=64, 8^3=512, 8^4=4096 \). Skip 0 digits (contribute nothing). Example: 305₈ = \( 3×64 + 0×8 + 5×1 = 192+5 = 197₁₀ \). Verification: Convert result back to octal using division method to double-check accuracy. Common values: 7₈=7₁₀; 10₈=8₁₀; 77₈=63₁₀; 100₈=64₁₀; 377₈=255₁₀ (max 3-digit octal = 8³-1); 777₈=511₁₀ (all 7s = 8³-1).

What does 0x mean in programming?

0x prefix indicates hexadecimal (base-16) number in programming. Convention adopted from C language, now standard in C++, Java, JavaScript, Python, Go, Rust, Swift, and most modern languages. Examples: 0xFF = 255 decimal (hex FF). 0x10 = 16 decimal (hex 10, not decimal 10). 0x00 = 0 decimal. 0xFFFFFFFF = 4,294,967,295 decimal (32-bit max unsigned). Why use 0x: (1) Distinguishes hex from decimal: 10 (decimal ten) vs 0x10 (hex 10 = decimal 16). (2) Compiler/interpreter recognizes hex literal automatically. (3) Bit patterns visible: 0xFF = 11111111 binary (all bits set in byte). (4) Memory addresses naturally hex: pointer value 0x7FFF5A2C. Code examples: C: int color = 0xFF0000; // red. JavaScript: const value = 0x1A3; // 419 decimal. Python: num = 0xFF # 255. Related prefixes: 0b = binary (0b1010 = 10 decimal). 0o or 0 = octal (0o12 or 012 = 10 decimal; leading 0 deprecated in modern code due to confusion). Output formatting: printf("%x", 255) outputs "ff" (lowercase hex without 0x). printf("0x%X", 255) outputs "0xFF" (uppercase with prefix). Common usage: Bit masks (0x0F = 00001111 for lower nibble); color codes (0xRRGGBB); hardware registers (write 0x80 to port); memory dumps (address 0x004A2B18).

How many bits in a hex digit?

One hexadecimal digit = exactly 4 binary bits (half a byte). Mathematical reason: 16 = 2⁴, so base-16 digit represents 4 base-2 digits. Range: 4 bits represent 0-15 decimal = 0-F hex = 0000-1111 binary. Bit-to-hex mapping: 0₁₆=0000₂, 1₁₆=0001₂, 2₁₆=0010₂, 3₁₆=0011₂, 4₁₆=0100₂, 5₁₆=0101₂, 6₁₆=0110₂, 7₁₆=0111₂, 8₁₆=1000₂, 9₁₆=1001₂, A₁₆=1010₂, B₁₆=1011₂, C₁₆=1100₂, D₁₆=1101₂, E₁₆=1110₂, F₁₆=1111₂. Practical implications: (1) Byte representation: 8 bits (1 byte) = 2 hex digits (00-FF = 0-255). Example: Byte value 10101100₂ = AC₁₆ (A=1010, C=1100). (2) Compact notation: 32-bit integer = 8 hex digits (0x00000000 to 0xFFFFFFFF). 64-bit = 16 hex digits. (3) Easy conversion: Binary ↔ hex trivial (group by 4 bits). Binary ↔ decimal requires calculation. Examples: 4-bit nibble: 1011₂ = B₁₆. 8-bit byte: 11111111₂ = FF₁₆. 16-bit word: 0001101000110101₂ = 1A35₁₆ (group: 0001|1010|0011|0101 = 1|A|3|5). 32-bit: 11111111111111111111111111111111₂ = FFFFFFFF₁₆. Why 4 bits matter: Nibble (half-byte, 4 bits) fundamental unit in computing. Binary-coded decimal (BCD) uses 4 bits per decimal digit. Hex provides perfect human-readable nibble representation.

Shares: