Enter Number to Convert

From Number System Decimal
Select the number system of your input number
Input Number 255
10
Enter decimal number (0-9)
Common Numbers Quick Select
Quickly select common computer science numbers
Convert To Systems All Systems
Select which number systems to convert to
Bit Length 32 bits
Select bit length for binary representation
Show signed integer representation using two's complement

All Number System Conversions

Decimal

Base-10
255
0-9 digits

Binary

Base-2
11111111
0-1 bits

Hexadecimal

Base-16
FF
0-9, A-F

Octal

Base-8
377
0-7 digits

Binary Bit Representation (32-bit)

MSB Most Significant Bit
Bit 31 Sign bit (for signed)
Bit 0 LSB (Least Significant Bit)

Number Properties

Odd
Even/Odd
No
Prime Number
8
Bits Required
No
Power of 2

ASCII Character

ÿ
Character
255
ASCII Code
0xFF
Hex Code
Extended
Type

Common Computer Science Values

Decimal Binary Hex Octal Description

About Number System Converter

The Number System Converter helps you convert between different numeral systems used in computing and mathematics. Convert between decimal (base-10), binary (base-2), hexadecimal (base-16), and octal (base-8) number systems.

How Number System Conversion Works

1

Decimal to Binary

Repeatedly divide by 2, record remainders in reverse order

255 ÷ 2 = 127 R1, 127 ÷ 2 = 63 R1, ... = 11111111

2

Binary to Hexadecimal

Group binary digits into sets of 4, convert each to hex

1111 1111 = F F = 0xFF

3

Binary to Octal

Group binary digits into sets of 3, convert each to octal

011 111 111 = 3 7 7 = 0377

4

Hex to Decimal

Multiply each digit by 16^position, sum results

0xFF = 15×16¹ + 15×16⁰ = 240 + 15 = 255

Number System Basics

System Base Digits Prefix/Suffix Common Uses
Decimal 10 0-9 None or d Everyday counting, mathematics
Binary 2 0-1 0b or b Computers, digital electronics
Hexadecimal 16 0-9, A-F 0x or h Programming, memory addresses
Octal 8 0-7 0 or o Unix permissions, older systems

Common Computer Science Values

Memory Sizes

  • 1 Byte: 8 bits = 0-255
  • 1 Kilobyte: 1024 bytes
  • 1 Megabyte: 1,048,576 bytes
  • 1 Gigabyte: 1,073,741,824 bytes

Bit Representations

  • 4 bits: 0-15 (1 hex digit)
  • 8 bits: 0-255 (1 byte)
  • 16 bits: 0-65535 (2 bytes)
  • 32 bits: 0-4,294,967,295

Programming Constants

  • NULL pointer: 0x00000000
  • MAX_INT: 0x7FFFFFFF
  • MIN_INT: 0x80000000
  • -1: 0xFFFFFFFF

Network Values

  • Subnet Mask: 255.255.255.0
  • Localhost: 127.0.0.1
  • Broadcast: 255.255.255.255
  • Private IP: 192.168.x.x

Two's Complement System

  • Purpose: Represent signed integers in binary
  • Range: For n bits: -2^(n-1) to 2^(n-1)-1
  • MSB: Most Significant Bit is sign bit (0=positive, 1=negative)
  • Positive Numbers: Same as unsigned binary
  • Negative Numbers: Invert all bits, then add 1
  • Zero: All bits are 0
  • Advantage: Single representation of zero, simple arithmetic

ASCII Character Codes

ASCII (American Standard Code for Information Interchange) uses 7 bits (0-127) to represent characters:

  • 0-31: Control characters (non-printable)
  • 32-126: Printable characters (letters, numbers, symbols)
  • 48-57: Digits 0-9
  • 65-90: Uppercase letters A-Z
  • 97-122: Lowercase letters a-z
  • 127: Delete character
  • 128-255: Extended ASCII (varies by system)
Note: Number system conversions are fundamental to computer science and digital electronics. When working with binary numbers, remember that leading zeros don't change the value. Hexadecimal is often used in programming because it's more compact than binary and easier to convert to/from binary than decimal.

How to convert decimal to binary?

To convert decimal to binary: Divide the number by 2, record remainder. Continue dividing quotient by 2 until quotient is 0. Read remainders in reverse order. Example: 13 → 1101.

How to convert binary to hexadecimal?

Group binary digits into sets of 4 (add leading zeros if needed). Convert each group to hex digit (0000=0 to 1111=F). Example: 11011010 → 1101 1010 → D A → 0xDA.

What is two's complement?

Two's complement is a method to represent signed integers in binary. For negative numbers: invert all bits (one's complement), then add 1. MSB indicates sign (0=positive, 1=negative).

Why is hexadecimal used in programming?

Hexadecimal is used because: 1) One hex digit = 4 binary bits, easy conversion. 2) More compact than binary. 3) Aligns with byte boundaries (2 hex digits = 1 byte). 4) Easier to read/write than long binary strings.

What is the maximum value for 8 bits?

For unsigned 8-bit: 255 (0xFF in hex, 11111111 in binary). For signed 8-bit using two's complement: 127 positive (0x7F), -128 negative (0x80).