Binary Hex Converter

Number system & bitwise operations

Enter Number

Enter a decimal number (0-9)
Invalid input for selected base
Bit Visualizer (8 bits) Value: 255
7
6
5
4
3
2
1
0

Common Values

Byte Range
Min: 0
Max: 255
Powers of 2
2⁸: 256
2¹⁶: 65,536
Common Hex
0xFF: 255
0x100: 256
Binary Patterns
11111111: 255
10101010: 170
Binary Base 2
Copy
11111111
Octal Base 8
Copy
377
Decimal Base 10
Copy
255
Hexadecimal Base 16
Copy
FF
Bit Count
8 bits
Ones Count
8
Zeros Count
0
Is Power of 2
No

Bit Distribution

Base Comparison

Bitwise Operations

Perform bitwise operations on two numbers

Result
170
Binary: 10101010

Bitwise Operations Explained

AND (&)

Returns 1 if both bits are 1, otherwise 0. Used for masking bits

OR (|)

Returns 1 if at least one bit is 1. Used for setting bits

XOR (^)

Returns 1 if bits are different. Used for toggling bits

NOT (~)

Inverts all bits (0→1, 1→0). Also called complement

Left Shift (<<)

Shifts bits left by n positions. Multiplies by 2^n

Right Shift (>>)

Shifts bits right by n positions. Divides by 2^n

ASCII Character Table

Decimal Hex Binary Character Description

Understanding Number Systems

What are Number Bases?

A number base (or radix) defines how many unique digits are used to represent numbers. The most common bases in computing are:

  • Binary (Base 2): Uses digits 0 and 1. Fundamental to all digital computers
  • Octal (Base 8): Uses digits 0-7. Was popular in early computing
  • Decimal (Base 10): Uses digits 0-9. Standard human numbering system
  • Hexadecimal (Base 16): Uses digits 0-9 and A-F. Compact representation of binary

Conversion Methods

Common conversion techniques:

  • Binary to Decimal: Sum of (bit × 2^position). Example: 1010 = 1×2³ + 0×2² + 1×2¹ + 0×2⁰ = 10
  • Decimal to Binary: Repeated division by 2, collect remainders
  • Binary to Hex: Group binary into 4-bit groups, convert each group
  • Hex to Binary: Convert each hex digit to 4-bit binary
  • Binary to Octal: Group binary into 3-bit groups, convert each group

Why Hexadecimal?

Hexadecimal is widely used in computing because:

  • Compact: Each hex digit represents 4 binary bits
  • Readable: Easier for humans to read than long binary strings
  • Aligned: 2 hex digits = 1 byte (8 bits)
  • Colors: Web colors use hex (#RRGGBB)
  • Memory addresses: Typically displayed in hex

Quick Conversion Tricks

  • Binary ↔ Hex: Group by 4 bits. 1111 = F, 1010 = A, 0101 = 5
  • Binary ↔ Octal: Group by 3 bits. 111 = 7, 110 = 6, 101 = 5
  • Powers of 2: 2⁰=1, 2¹=2, 2²=4, 2³=8, 2⁴=16, 2⁸=256
  • Byte values: 0-255 (8 bits), 0-65535 (16 bits)

Practical Applications

  • Programming: Bitwise operations, flags, masks
  • Networking: IP addresses, MAC addresses, subnet masks
  • Web Development: Color codes (#RRGGBB)
  • Hardware: Memory addresses, register values
  • Cryptography: Encryption algorithms, hash functions

Tips & Tricks

Hex Digits

0-9 = 0-9, A=10, B=11, C=12, D=13, E=14, F=15

Binary Groups

Group binary by 4 for hex, by 3 for octal. Makes conversion easy

Prefix Notation

0b for binary, 0o for octal, 0x for hex in many programming languages

Byte Boundaries

Common sizes: 8-bit (1 byte), 16-bit (2 bytes), 32-bit (4 bytes), 64-bit (8 bytes)

Understanding Number Systems

Number systems are fundamental to computing. Every digital computer uses binary (base 2) internally, but programmers often work with hexadecimal (base 16) for compactness and octal (base 8) for certain applications. Understanding how to convert between these systems is essential for programming, networking, and hardware work.

Common Number Bases

The four main number bases used in computing:

  • Binary (Base 2): Digits 0-1. Example: 1010 = 10 in decimal
  • Octal (Base 8): Digits 0-7. Example: 12 = 10 in decimal
  • Decimal (Base 10): Digits 0-9. Standard numbering system
  • Hexadecimal (Base 16): Digits 0-9, A-F. Example: A = 10 in decimal

Conversion Methods

Common conversion techniques:

  • Binary to Decimal: Sum of (bit × 2^position)
  • Decimal to Binary: Repeated division by 2, collect remainders
  • Binary to Hex: Group by 4 bits, convert each group
  • Binary to Octal: Group by 3 bits, convert each group
  • Hex to Binary: Each hex digit → 4 binary bits

Why Hexadecimal?

Hexadecimal is widely used because:

  • Compact: Each hex digit = 4 binary bits
  • Readable: Easier than long binary strings
  • Byte-aligned: 2 hex digits = 1 byte (8 bits)
  • Web colors: #RRGGBB format
  • Memory addresses: Typically shown in hex

Using This Converter

Follow these steps:

  • Step 1: Select the input base (Binary, Octal, Decimal, or Hex)
  • Step 2: Enter your number in the selected base
  • Step 3: See instant conversion to all four bases
  • Step 4: View the bit visualizer showing binary representation
  • Step 5: Check statistics (bit count, ones/zeros count)
  • Step 6: Click on any result to copy to clipboard
  • Step 7: Try bitwise operations in the Bitwise Ops tab
  • Step 8: Explore the ASCII table in the ASCII tab

More Computer & Programming Tools

Explore more computer and programming calculators in our collection, including Database Size Estimator, Cloud Storage Pricing, and Unix Timestamp Calculator!