Skip to content

Text to ASCII Converter

Convert text to ASCII codes and decode ASCII values to text

0 characters 0 bytes

Output Format

Separator

Quick Examples

ASCII Table - Printable Characters

Char Dec Hex Bin Char Dec Hex Bin
␣322000100000 @644001000000
A654101000001 a976101100001
B664201000010 b986201100010
Z905A01011010 z1227A01111010
0483000110000 9573900111001
!332100100001 ?633F00111111

ASCII Control Characters (0-31)

Dec Abbr Name Dec Abbr Name
0NULNull 13CRCarriage Return
7BELBell 27ESCEscape
9TABHorizontal Tab 32SPSpace
10LFLine Feed 127DELDelete

Complete Guide to ASCII Encoding and Character Codes

ASCII (American Standard Code for Information Interchange) forms the foundation of text representation in computing, establishing a universal mapping between characters and numeric values that remains fundamental to programming, networking, and data processing. Our free text to ASCII converter transforms characters to their numeric codes in multiple formats while enabling reverse conversion from ASCII values back to readable text.

The History of ASCII

ASCII emerged from telegraph communication needs in the early 1960s, with the standard finalized in 1963 by the American Standards Association (now ANSI). The encoding addressed incompatibility between different computer manufacturers' character sets, creating a universal standard. The 7-bit design accommodated the 128 characters deemed essential for English text communication: 33 control characters, 95 printable characters including uppercase and lowercase letters, digits, punctuation, and mathematical symbols. This elegant simplicity enabled ASCII to become the lingua franca of computing.

Understanding the ASCII Table Structure

ASCII organizes characters into logical groups by their numeric values. Control characters occupy codes 0-31, handling non-printable functions like carriage return (13), line feed (10), and tab (9). Space (32) bridges control and printable characters. Digits 0-9 span codes 48-57. Uppercase letters A-Z occupy 65-90, while lowercase a-z use 97-122—a 32-value offset enabling simple case conversion. Punctuation and symbols fill remaining positions. This deliberate arrangement simplifies programming tasks like alphabetic sorting and character classification.

ASCII in Programming Languages

Every major programming language provides ASCII functionality. C's char type stores ASCII values directly; 'A' equals integer 65. Python's ord() returns a character's ASCII code while chr() converts codes to characters. JavaScript's charCodeAt() and String.fromCharCode() perform similar operations. Understanding ASCII enables character manipulation like case conversion (add/subtract 32), digit extraction (subtract 48), and input validation (check value ranges). These fundamentals appear throughout string processing, parsing, and data validation code.

Extended ASCII and Code Pages

While standard ASCII uses 7 bits (0-127), early computers used 8-bit bytes, leaving codes 128-255 undefined. Various"extended ASCII" code pages filled this space with additional characters—accented letters, box-drawing characters, and regional symbols. Windows-1252 (Western European), ISO-8859-1 (Latin-1), and others provided different extensions, creating compatibility challenges. Documents created with one code page displayed incorrectly with another, motivating the eventual development of Unicode as a universal character standard.

ASCII's Relationship to Unicode and UTF-8

Unicode adopted ASCII as its first 128 code points, ensuring backward compatibility. UTF-8, the dominant Unicode encoding, represents ASCII characters as single bytes identical to their ASCII codes—"A" is byte 0x41 in both ASCII and UTF-8. Characters beyond ASCII require multiple bytes in UTF-8. This compatibility means ASCII text is automatically valid UTF-8, enabling gradual migration from ASCII to Unicode without breaking existing systems. Modern applications should use UTF-8 while maintaining ASCII awareness for legacy integration.

Network Protocols and ASCII

Many internet protocols rely on ASCII for human-readable commands. HTTP headers, SMTP email transmission, FTP commands, and DNS queries use ASCII text. Protocol debugging involves reading and interpreting ASCII sequences in network captures. Understanding ASCII control characters like CR-LF (carriage return + line feed, codes 13 and 10) is essential—HTTP uses CR-LF to separate headers, while Unix systems use LF alone, causing cross-platform issues. ASCII knowledge remains vital for network programming and troubleshooting.

Control Characters and Terminal Emulation

ASCII control characters (0-31) originally controlled teletype machines and remain relevant in terminal emulation. The escape character (27) initiates ANSI escape sequences controlling cursor position, text colors, and terminal modes. Bell (7) produces an audible alert. Backspace (8), tab (9), and form feed (12) control text positioning. Modern terminal applications interpret these codes for text-based user interfaces. Command-line tools leverage control characters for progress bars, colored output, and interactive displays.

Data Interchange and File Formats

Many data formats rely on ASCII structure. CSV files use ASCII commas, quotes, and newlines as delimiters. JSON and XML use ASCII brackets, braces, and angle brackets for structure. Configuration files employ ASCII equals signs, colons, and brackets. Understanding ASCII enables manual inspection of these formats when debugging parsing issues. The printable ASCII range (32-126) defines"safe" characters for filenames, URLs, and identifiers across operating systems and programming languages.

Binary Representation of ASCII

ASCII's 7-bit design means each character occupies 7 bits with values 0-127. The binary patterns reveal useful properties: uppercase letters share the pattern 01XXXXX (bit 6 set), while lowercase letters use 011XXXX (bits 6 and 5 set). Digits follow 0011XXXX. Converting between uppercase and lowercase requires flipping only bit 5 (value 32). This bit-level organization enables efficient character processing in assembly language and hardware implementations. Understanding binary ASCII representation aids low-level debugging and data analysis.

Security Considerations

ASCII awareness is crucial for security. Null byte (ASCII 0) injection attacks exploit C-style string termination. Control character injection can manipulate logs or terminal output. ASCII-based protocols may be vulnerable to injection when special characters like semicolons or pipes aren't properly escaped. Input validation often involves checking that user input contains only expected ASCII ranges. Understanding the full ASCII table, including non-printable characters, helps identify and prevent injection vulnerabilities in applications handling text data.

Educational Importance

Learning ASCII provides foundational understanding of how computers represent text. Students grasp that characters are ultimately numbers, enabling mathematical operations on text. The ASCII table demonstrates deliberate design decisions—alphabetic ordering matching numeric ordering, case conversion through bit manipulation, digits maintaining their face value relationship (subtract 48). This knowledge transfers to understanding other encoding systems, database character handling, and internationalization challenges. ASCII mastery marks a milestone in computer science education.

Common ASCII Patterns for Programmers

Character Ranges

  • • Digits 0-9: 48-57
  • • Uppercase A-Z: 65-90
  • • Lowercase a-z: 97-122
  • • Printable: 32-126

Useful Tricks

  • • Upper to lower: char + 32
  • • Lower to upper: char - 32
  • • Char to digit: char - 48
  • • Toggle case: char XOR 32

$ faq

What is ASCII encoding? ▸
ASCII (American Standard Code for Information Interchange) is a character encoding standard that assigns numeric values to characters. Standard ASCII uses 7 bits to represent 128 characters (0-127), including uppercase and lowercase letters, digits, punctuation, and control characters. Extended ASCII uses 8 bits for 256 characters (0-255). Each character maps to a unique decimal number.
How does text to ASCII conversion work? ▸
Each character in text has a corresponding ASCII code. The converter reads each character and outputs its numeric value. For example, "A" equals 65, "a" equals 97, "0" equals 48, and space equals 32. The output can be displayed in decimal, binary, hexadecimal, or octal format depending on your needs.
What output formats are available? ▸
The converter offers multiple formats: Decimal (65 66 67), Binary (01000001 01000010), Hexadecimal (41 42 43), and Octal (101 102 103). You can also choose different separators including space, comma, newline, or no separator. Each format serves different programming and analysis contexts.
Can I convert ASCII codes back to text? ▸
Yes, switch to decode mode and enter ASCII values in decimal format. The converter accepts space-separated, comma-separated, or newline-separated numbers. Each number (0-255) converts to its corresponding character. Invalid values or numbers outside the valid range are skipped or shown as replacement characters.
What is the difference between ASCII and Unicode? ▸
ASCII covers only 128 (or 256 for extended ASCII) characters, primarily English letters and basic symbols. Unicode encompasses over 140,000 characters from all writing systems worldwide. ASCII values 0-127 are identical in Unicode (UTF-8), making ASCII a subset of Unicode. This converter handles standard ASCII range; non-ASCII characters produce multiple bytes in UTF-8.
Why are ASCII codes important in programming? ▸
ASCII codes enable character manipulation in programming—comparing characters, converting case (uppercase/lowercase differ by 32), validating input, generating character sequences, and understanding string encoding. Knowledge of ASCII is fundamental for working with text data, file formats, network protocols, and low-level programming.
Is my text data kept private? ▸
Yes, all encoding and decoding happens entirely in your browser using JavaScript. Your text is never uploaded to any server, stored, or transmitted. Once you close the page, all data is immediately cleared from memory, ensuring complete privacy for any content you convert.