ASCII Converter

Convert text to ASCII codes and back. Supports multiple formats: decimal, hexadecimal, binary, and octal. Essential for programming and data analysis.

0 characters

About ASCII

ASCII (American Standard Code for Information Interchange) is a character encoding standard that assigns numerical codes to letters, numbers, symbols, and control characters. It's the foundation of text representation in computers.

ASCII Character Sets

Control Characters (0-31)

  • • 0: NULL (null character)
  • • 7: BEL (bell/alert)
  • • 8: BS (backspace)
  • • 9: TAB (horizontal tab)
  • • 10: LF (line feed/newline)
  • • 13: CR (carriage return)
  • • 27: ESC (escape)

Printable Characters (32-126)

  • • 32: Space
  • • 33-47: Punctuation (!@#$%)
  • • 48-57: Digits (0-9)
  • • 65-90: Uppercase (A-Z)
  • • 97-122: Lowercase (a-z)
  • • 123-126: Symbols ({|}~)

Common ASCII Codes

CharacterDecimalHexBinaryDescription
Space322000100000Whitespace
0483000110000Digit zero
A654101000001Uppercase A
a976101100001Lowercase a
!332100100001Exclamation

ASCII vs Unicode

FeatureASCIIUnicode (UTF-8)
Character Count128 (7-bit) or 256 (8-bit)Over 149,000 characters
Language SupportEnglish onlyAll world languages
Emoji Support❌ No✓ Yes
Size1 byte per character1-4 bytes per character
CompatibilityUniversal legacy supportBackward compatible with ASCII

Common Use Cases

  • Data Transmission: Sending text data between systems
  • File Formats: CSV, TXT, and plain text files
  • Programming: Character manipulation and string processing
  • Debugging: Inspect character codes in data
  • Protocols: HTTP, SMTP, FTP use ASCII
  • Sorting: Alphabetical ordering based on ASCII values

Interesting ASCII Facts

Case Conversion Trick

To convert between uppercase and lowercase, just flip the 6th bit (add or subtract 32). For example: 'A' (65) + 32 = 'a' (97). This works because the designers intentionally placed uppercase and lowercase letters 32 positions apart.

Digit to Number Conversion

To convert the character '5' to the number 5, subtract 48 (ASCII code of '0'). This is why '0' starts at 48: '5' (53) - 48 = 5. This pattern works for all digits 0-9.

Historical Origin

ASCII was developed in the 1960s for teletype machines. The code 127 (DEL) was designed to erase mistakes on paper tape by punching all holes, allowing the tape to be physically cut and spliced.

Frequently Asked Questions

What's the difference between ASCII and UTF-8?

ASCII is a 7-bit encoding supporting 128 characters (0-127). UTF-8 is backward compatible with ASCII for the first 128 characters, but extends to support over 1 million characters using 1-4 bytes per character. For English text, ASCII and UTF-8 are identical.

Why does 'A' start at 65, not 1?

The first 32 codes (0-31) are reserved for control characters like newline, tab, and backspace. Code 32 is space. Printable characters start at 33. The designers placed digits before letters, so 'A' ended up at 65 (after digits 48-57 and punctuation).

Can ASCII represent emojis?

No, ASCII cannot represent emojis. Emojis are part of Unicode (typically in the U+1F600 range). You need UTF-8, UTF-16, or UTF-32 encoding to display emojis. ASCII is limited to basic English characters, digits, and symbols.

What is extended ASCII?

Extended ASCII uses 8 bits instead of 7, supporting 256 characters (0-255). Characters 128-255 vary by encoding (ISO-8859-1, Windows-1252, etc.) and include accented letters and symbols. However, extended ASCII is largely obsolete, replaced by Unicode.

How do I type ASCII characters by code?

On Windows, hold Alt and type the decimal code on the numpad (e.g., Alt+65 = A). On Mac, it's more complex and varies by character. On Linux, use Ctrl+Shift+U followed by the hex code. Most modern systems use Unicode input methods instead.

Why is the space character code 32?

Code 32 is perfectly positioned: it's 2^5, making it easy to remember and calculate. It's also exactly 32 positions before uppercase letters, enabling the uppercase/lowercase conversion trick. This placement was intentional in ASCII's design.