Number Base Converter

Convert numbers between binary, decimal, hexadecimal, and octal. Essential tool for programming and computer science.

Enter Number in Any Base

Quick Reference (0-16)

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

What It Does

Number Base Converter converts numbers between different numeral systems (bases): binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Binary uses only 0 and 1, representing numbers in base-2 (essential for computers). Octal uses digits 0-7, representing numbers in base-8 (less common, used in some Unix file permissions). Decimal uses digits 0-9, representing numbers in base-10 (standard human numbering). Hexadecimal uses digits 0-9 and letters A-F, representing numbers in base-16 (widely used in programming for memory addresses, colors, and binary data representation). This tool provides instant conversion between all bases, displays all conversions simultaneously, and handles large numbers. Essential for programmers, computer science students, digital electronics engineers, and anyone working with low-level programming, memory addresses, bit manipulation, or understanding how computers represent numbers.

Key Features:

  • Binary (base 2): Convert to/from binary using 0 and 1
  • Octal (base 8): Convert to/from octal using digits 0-7
  • Decimal (base 10): Convert to/from standard decimal numbers
  • Hexadecimal (base 16): Convert to/from hex using 0-9 and A-F
  • Simultaneous conversion: See all bases at once as you type
  • Large number support: Handle very large integers
  • Real-time updates: Conversions update instantly as you type
  • Copy individual results: Copy any base format independently

How To Use

Enter a number in any base (binary, octal, decimal, or hexadecimal) and instantly see its equivalent in all other bases. Perfect for programming, computer science, and digital electronics.

1

Enter Number in Any Base

Type or paste a number in the input field for your chosen base. For binary, use only 0 and 1 (e.g., "1010"). For octal, use digits 0-7 (e.g., "755"). For decimal, use digits 0-9 (e.g., "255"). For hexadecimal, use digits 0-9 and letters A-F (e.g., "FF" or "ff").

2

View All Conversions

The tool automatically displays the equivalent number in all other bases simultaneously. As you type in one base, all other bases update in real-time. See binary, octal, decimal, and hexadecimal representations all at once.

3

Copy Result

Click the copy button next to any base format to copy that representation to your clipboard. Use it in your code, calculations, or documentation.

Pro Tips

  • Hexadecimal is commonly used for memory addresses (0x7FFF), colors (#FF0000), and binary data
  • Binary is essential for bitwise operations and understanding computer internals
  • Octal is less common but used in Unix file permissions (chmod 755)
  • Decimal is standard for human-readable numbers and calculations
  • Hexadecimal digits A-F represent decimal values 10-15
  • Leading zeros are preserved in conversions (important for fixed-width formats)

Benefits

Programming: Convert between bases for memory addresses, bit flags, and data representation
Education: Learn number systems and understand computer fundamentals
Debugging: Understand how numbers are stored and represented in memory
Digital Electronics: Work with binary and hexadecimal in circuit design
Color Codes: Convert hexadecimal color codes to decimal RGB values
File Permissions: Understand and convert Unix octal file permissions
Bit Manipulation: Work with binary for bitwise operations and flags

Use Cases

Memory Address Conversion

Convert hexadecimal memory addresses to decimal for understanding and debugging. Example: Memory address 0x7FFF (hex) = 32767 (decimal) = 0111111111111111 (binary). Programmers use hex for memory addresses because they're more compact than binary and align with byte boundaries (2 hex digits = 1 byte). Convert between formats to understand pointer values, array indices, and memory layouts.

Hex: 0x7FFF → Decimal: 32767 → Binary: 0111111111111111

Color Code Conversion

Convert hexadecimal color codes to decimal RGB values. Example: Color #FF0000 (red) in hex = RGB(255, 0, 0) in decimal. FF in hex = 255 in decimal, 00 = 0. Web colors use hex (#RRGGBB), but some APIs and graphics libraries use decimal RGB. Convert between formats for CSS, graphics programming, and color manipulation.

Hex: #FF5733 → RGB: (255, 87, 51) → Binary: 11111111 01010111 00110011

Unix File Permissions

Convert octal file permissions to binary for understanding bit patterns. Example: chmod 755 in octal = 111 101 101 in binary. Each digit represents 3 bits: read (4), write (2), execute (1). 7 = 4+2+1 (all permissions), 5 = 4+1 (read+execute), 0 = no permissions. Understanding binary helps visualize permission bits and calculate permission values.

Octal: 755 → Binary: 111 101 101 → Decimal: 493

Bitwise Operations

Convert numbers to binary for bitwise AND, OR, XOR operations. Example: 5 AND 3. 5 in binary = 101, 3 in binary = 011. AND operation: 101 AND 011 = 001 = 1 in decimal. Understanding binary is essential for bit flags, masks, and low-level programming. Convert results back to decimal to verify operations.

5 (101) AND 3 (011) = 1 (001)

Data Representation

Understand how computers store numbers in different formats. Example: The number 255 can be represented as: 11111111 (binary, 8 bits), 377 (octal), 255 (decimal), FF (hexadecimal, 2 digits). All represent the same value but use different bases. This is crucial for understanding data types, byte order (endianness), and binary file formats.

255 = 11111111 (binary) = 377 (octal) = FF (hex)

Frequently Asked Questions

1 Why do programmers use hexadecimal instead of binary?
Hexadecimal is more compact and readable than binary while still being easy to convert to binary. One hex digit represents 4 bits (a "nibble"), so 2 hex digits = 1 byte (8 bits). For example, the byte 11111111 in binary is just "FF" in hex. Hex aligns perfectly with byte boundaries, making it ideal for memory addresses, binary data, and byte-oriented operations. Binary is too verbose (8 digits per byte), decimal doesn't align with bytes, but hex provides the perfect balance: compact, readable, and byte-aligned. That's why memory addresses, color codes, and binary data are commonly displayed in hex.
2 How do I convert between bases manually?
To convert from any base to decimal: Multiply each digit by its base raised to its position power, then sum. Example: Binary 1010 to decimal: (1×2³) + (0×2²) + (1×2¹) + (0×2⁰) = 8 + 0 + 2 + 0 = 10. To convert from decimal to any base: Repeatedly divide by the target base and collect remainders in reverse order. Example: Decimal 10 to binary: 10 ÷ 2 = 5 remainder 0, 5 ÷ 2 = 2 remainder 1, 2 ÷ 2 = 1 remainder 0, 1 ÷ 2 = 0 remainder 1. Read remainders backwards: 1010. For hex, use A-F for remainders 10-15. This tool automates these calculations.
3 What are the maximum values for different bit lengths?
8 bits (1 byte): 0 to 255 (binary: 00000000 to 11111111, hex: 00 to FF). 16 bits (2 bytes): 0 to 65,535 (hex: 0000 to FFFF). 32 bits (4 bytes): 0 to 4,294,967,295 (hex: 00000000 to FFFFFFFF). 64 bits (8 bytes): 0 to 18,446,744,073,709,551,615. Signed integers use half the range for negative numbers: 8-bit signed = -128 to 127, 16-bit signed = -32,768 to 32,767. These limits are important for data types (uint8, int16, etc.) and overflow prevention. The converter handles numbers of any size.
4 Why is octal less common than hex?
Octal (base 8) is less common because it doesn't align well with bytes. One byte is 8 bits, which doesn't divide evenly into groups of 3 (octal digits represent 3 bits). Hexadecimal is preferred because 1 hex digit = 4 bits, and 2 hex digits = 1 byte (8 bits), making it perfect for byte-oriented data. Octal is still used for Unix file permissions (chmod) because permissions are grouped in 3-bit sets (read, write, execute), but for general programming and data representation, hex is standard. Octal requires 3 digits to represent a byte (0-377), while hex needs only 2 (00-FF).
5 Can I convert floating-point numbers?
This converter focuses on integers. Floating-point numbers (decimals) use a different representation system (IEEE 754) that includes sign bit, exponent, and mantissa. Converting floating-point between bases is complex and not commonly needed. For integers, the converter handles whole numbers in all bases. If you need to work with decimal numbers, convert the integer part and fractional part separately, or use specialized floating-point conversion tools. Most use cases (memory addresses, colors, permissions, bit flags) involve integers, which this tool handles perfectly.

Related Tools