Number System Converter - Binary, Decimal, Octal, Hexadecimal

Convert numbers between different number systems instantly. Enter a value in any field and see automatic conversions to Binary (Base 2), Octal (Base 8), Decimal (Base 10), and Hexadecimal (Base 16).

How to use: Type or paste a number into any field below. All other number systems will be calculated automatically. Use the copy buttons to copy results.

10

Decimal (Base 10)

Standard number system (0-9)

Length: 3 digits

2

Binary (Base 2)

Only 0 and 1 (computers use this)

Length: 7 bits

8

Octal (Base 8)

Digits 0-7 (used in Unix permissions)

Length: 3 digits

16

Hexadecimal (Base 16)

Digits 0-9 and A-F (used in colors)

Length: 2 characters

Advertisement

Quick Reference: Common Conversions

Decimal Binary Octal Hexadecimal
0000
1111
81000108
10101012A
15111117F
16100002010
100110010014464
25511111111377FF
256100000000400100
1024100000000002000400

Understanding Number Systems

10

Decimal (Base 10)

The standard number system we use daily. It has 10 digits (0-9) and each position represents a power of 10.

Example: 125 = (1×10²) + (2×10¹) + (5×10⁰)

= 100 + 20 + 5

2

Binary (Base 2)

Used by computers. Only uses two digits (0 and 1). Each position represents a power of 2.

Example: 101 = (1×2²) + (0×2¹) + (1×2⁰)

= 4 + 0 + 1 = 5 in decimal

8

Octal (Base 8)

Uses 8 digits (0-7). Commonly used in Unix file permissions. Each position represents a power of 8.

Example: 17 = (1×8¹) + (7×8⁰)

= 8 + 7 = 15 in decimal

16

Hexadecimal (Base 16)

Uses 16 digits (0-9, A-F). Common in web colors and memory addresses. Each position represents a power of 16.

Example: 2F = (2×16¹) + (15×16⁰)

= 32 + 15 = 47 in decimal

Real-World Applications

Computer Science

Binary is fundamental to how computers process and store information. Understanding binary helps programmers work with bits, bytes, and low-level operations.

Web Design

Hexadecimal is used for color codes in CSS and HTML. For example, #FF0000 represents red, where FF is the maximum red value (255 in decimal).

File Permissions

Unix/Linux systems use octal notation for file permissions. For example, chmod 755 sets read-write-execute permissions using octal values.

Network Addresses

IP addresses and MAC addresses are often represented in hexadecimal or binary. Understanding conversions helps with network configuration and troubleshooting.

Digital Electronics

Binary logic gates (AND, OR, NOT) form the basis of all digital circuits. Understanding binary is essential for hardware design and debugging.

Data Storage

Understanding how numbers are stored in binary helps optimize data structures, compression algorithms, and memory usage in applications.

How to Convert Between Number Systems

Decimal to Binary

Divide the decimal number by 2 repeatedly and record the remainders from bottom to top.

Example: Convert 13 to binary

13 ÷ 2 = 6 remainder 1

6 ÷ 2 = 3 remainder 0

3 ÷ 2 = 1 remainder 1

1 ÷ 2 = 0 remainder 1

Result: 1101 (read remainders from bottom to top)

Binary to Decimal

Multiply each digit by 2 raised to its position (counting from right, starting at 0) and sum the results.

Example: Convert 1011 to decimal

(1 × 2³) + (0 × 2²) + (1 × 2¹) + (1 × 2⁰)

= 8 + 0 + 2 + 1

Result: 11

Hexadecimal to Decimal

Multiply each digit by 16 raised to its position and sum the results. Remember A=10, B=11, C=12, D=13, E=14, F=15.

Example: Convert 2A to decimal

(2 × 16¹) + (10 × 16⁰)

= 32 + 10

Result: 42

Binary to Hexadecimal (Shortcut)

Group binary digits into sets of 4 (from right to left) and convert each group to its hex equivalent.

Example: Convert 11010110 to hex

Group: 1101 0110

1101 = D (13 in decimal)

0110 = 6

Result: D6

Frequently Asked Questions

Why do computers use binary?

Computers use binary because digital circuits can easily represent two states: on (1) and off (0). These correspond to high and low voltage levels in transistors. It's much more reliable and simpler to distinguish between two states than multiple voltage levels.

What's the difference between bits and bytes?

A bit is a single binary digit (0 or 1). A byte is a group of 8 bits. For example, the binary number 11111111 is one byte (8 bits) and equals 255 in decimal. Bytes are the standard unit for measuring computer memory and file sizes.

Why is hexadecimal used in programming?

Hexadecimal is more compact than binary while being easy to convert. One hex digit represents exactly 4 binary digits. This makes it perfect for representing large binary numbers concisely, especially for memory addresses, color codes, and data dumps.

What is the largest number I can convert?

This converter supports numbers up to JavaScript's maximum safe integer (2⁵³ - 1, or 9,007,199,254,740,991 in decimal). Beyond this limit, precision may be lost. For extremely large numbers, specialized arbitrary-precision libraries are needed.

Can I convert negative numbers?

This tool currently supports positive integers only. Negative numbers in binary use different representations like two's complement, which requires specifying a bit width (8-bit, 16-bit, etc.). For negative number conversions, specialized tools are more appropriate.

What are common prefix notations?

In programming, prefixes indicate number bases: 0b or 0B for binary (0b1010), 0o or 0O for octal (0o755), 0x or 0X for hexadecimal (0xFF). These help prevent confusion when working with different number systems in code.

How accurate is this converter?

The converter uses JavaScript's built-in parseInt() and toString() methods with specified radix values. It's accurate for all integers within JavaScript's safe integer range. All conversions are performed client-side in your browser.

Can I convert decimal numbers (fractions)?

This tool handles whole numbers (integers) only. Converting fractional numbers to binary, octal, or hexadecimal requires different algorithms as the fractional part is converted separately from the integer part.

Tips for Working with Number Systems

  • Memorize Powers of 2: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024... These are essential for quick binary conversions
  • Group Binary Digits: For readability, group binary in sets of 4 or 8. Example: 1010 1100 instead of 10101100
  • Use Prefixes in Code: Always use 0x for hex, 0b for binary, and 0o for octal in your code to avoid confusion
  • Practice Hex-to-Binary: Learn to quickly convert hex to binary by memorizing the 16 patterns (0=0000, 1=0001, ... F=1111)
  • Check Your Work: Always verify conversions, especially when working with critical systems or security-related code
  • Understand Context: Different fields use different systems. Web developers use hex for colors, system admins use octal for permissions

Related Tools

Discover more tools that might interest you. Here are some related and popular tools you might find useful!

Case Converter

Case Converter

Convert text between uppercase, lowercase, title case, sentence case, and more with our free online case converter tool.

Letter Counter

Letter Counter

Count characters, words, sentences, and paragraphs in your text. Perfect for essays, articles, tweets, and social media posts.

Lorem Ipsum Generator

Lorem Ipsum Generator

Generate Lorem Ipsum placeholder text for your designs, mockups, and prototypes. Customize paragraphs, words, and characters.

Roman Languages

Roman Languages

Write Any language in roman english and convert text to that specific language

Text Reverser & Randomizer

Text Reverser & Randomizer

Reverse text, shuffle characters, or shuffle words. Useful for fun or testing.

Text to ASCII Converter

Text to ASCII Converter

Convert text to ASCII decimal codes. Translate strings into their corresponding ASCII numeric values.

Text to Binary Converter

Text to Binary Converter

Convert text to binary (0s and 1s). Translate strings into binary code.

Text to Hex Converter

Text to Hex Converter

Convert text to Hexadecimal. Translate strings into hex codes.

Base64 Encoder/Decoder

Base64 Encoder/Decoder

Easily encode and decode text to and from Base64 format. Features real-time conversion, copy to clipboard, download results, character counter, and sample data. Perfect for encoding data for URLs, APIs, and web development.

Blacklist Lookup

Blacklist Lookup

Check if your domain or IP address is blacklisted on 20+ DNS-based blacklists (DNSBL). Protect your email deliverability and website reputation.

Broken Links Finder

Broken Links Finder

Find and fix broken links on your website.

Claymorphism CSS Generator

Claymorphism CSS Generator

Create stunning clay-like 3D design effects with custom CSS code. Generate claymorphism styles with live preview.

Advertisement

Comments

Sign in or create an account to leave a comment.

No comments yet

Be the first to share your thoughts!