ASCII Converter
Convert text to ASCII codes (decimal, hex, binary, octal) and decode ASCII values back to readable text. Enter any character or string to see its ASCII representation, or paste ASCII code numbers to decode them instantly.
ASCII Converter
Convert text to ASCII codes or decode ASCII values back to characters.
Frequently Asked Questions
What is ASCII?
ASCII (American Standard Code for Information Interchange) is a character encoding standard that assigns a unique numeric value to 128 characters, including letters (A-Z, a-z), digits (0-9), punctuation marks, and control characters. Developed in the early 1960s and standardized in 1968, ASCII was the dominant character encoding for computers and telecommunications for decades. Each character is represented by a 7-bit integer from 0 to 127, though it is typically stored as an 8-bit byte.
How do you convert text to ASCII?
To convert text to ASCII, look up the decimal code for each character in the ASCII table. For example, the letter 'A' has the ASCII code 65, 'B' is 66, and lowercase 'a' is 97. Spaces have ASCII code 32. To express these in hexadecimal, convert each decimal code: 65 in decimal is 41 in hex. In binary, 65 is 01000001. Most programming languages provide built-in functions for this conversion, such as ord() in Python, charCodeAt() in JavaScript, or (int) casting in C.
What is the ASCII code for a space?
The ASCII code for a space character is 32 in decimal (20 in hexadecimal, 00100000 in binary). Space (code 32) is the lowest-numbered printable ASCII character. Codes 0-31 and 127 are control characters used for communication control (like newline, tab, carriage return) rather than printable symbols. Among these, horizontal tab is code 9, line feed (newline) is code 10, and carriage return is code 13.
What is the difference between ASCII and Unicode?
ASCII uses 7 bits to represent 128 characters, covering English letters, digits, and common symbols. Unicode is a much larger standard that encodes over 149,000 characters from virtually all writing systems worldwide, including Chinese, Arabic, emoji, and mathematical notation. ASCII characters occupy exactly the same positions (0-127) in Unicode, so all ASCII text is valid Unicode. Unicode uses UTF-8 as its most common encoding, where ASCII characters are stored in 1 byte while other characters use 2-4 bytes.
What are ASCII control characters?
ASCII control characters are the first 32 codes (0-31) plus code 127 (DEL). They are non-printable characters originally used to control communication devices and terminals. Common examples include: NUL (0) — null terminator used to end strings in C; TAB (9) — horizontal tab; LF (10) — line feed / newline used in Unix systems; CR (13) — carriage return used in old typewriters and Windows line endings (CRLF); ESC (27) — escape character used to start terminal escape sequences; DEL (127) — delete.
What is the difference between uppercase and lowercase in ASCII?
In ASCII, uppercase letters A-Z have codes 65-90, and lowercase letters a-z have codes 97-122. The difference between any uppercase letter and its lowercase counterpart is exactly 32 (for example, A=65 and a=97; B=66 and b=98). In binary, this difference is bit 5 (value 32): uppercase letters have bit 5 set to 0 and lowercase have it set to 1. This elegant design means you can toggle case by flipping a single bit, which makes case conversion extremely efficient in low-level programming.
What is extended ASCII?
Extended ASCII refers to various 8-bit character encodings that use codes 128-255 to add additional characters beyond the original 128 ASCII characters. Unlike the standard ASCII range (0-127), which is universally agreed upon, codes 128-255 vary by encoding. Common extensions include ISO 8859-1 (Latin-1) which adds Western European characters like accented letters (é, ü, ñ), and Windows-1252 which is similar but includes typographic symbols. Extended ASCII is largely superseded by Unicode for modern applications.
How does ASCII relate to UTF-8?
UTF-8 is designed to be backward-compatible with ASCII. For the first 128 code points (0-127), UTF-8 uses exactly the same single byte as ASCII. This means any valid ASCII text is also valid UTF-8 without modification. For characters beyond 127, UTF-8 uses multi-byte sequences of 2 to 4 bytes, with the leading byte indicating the sequence length. This backward compatibility made UTF-8 easy to adopt and is one reason it became the dominant encoding on the internet, representing over 98% of web pages.
How do you convert ASCII codes to text?
To convert ASCII decimal codes back to text, look up each number in the ASCII table and write the corresponding character. For example, the sequence 72, 101, 108, 108, 111 spells 'Hello' (H=72, e=101, l=108, l=108, o=111). For hexadecimal input, convert each hex value to decimal first (or look it up directly). In programming, use chr() in Python, String.fromCharCode() in JavaScript, or cast an integer to char in C/C++ and Java.
What is the ASCII code for a newline?
There are two ASCII control characters related to newlines: Line Feed (LF, code 10) and Carriage Return (CR, code 13). Unix/Linux and macOS use LF alone (\n) to end lines. Windows uses the combination CR+LF (\r\n, codes 13 and 10). Old Mac OS used CR alone. LF originated from the mechanical action of advancing paper one line on a printer, while CR moved the print head back to the start of the line — both were needed on physical terminals.
What Is ASCII?
ASCII (American Standard Code for Information Interchange) is a character encoding standard that maps 128 characters to numeric values (0–127). It covers the English alphabet (upper and lowercase), digits 0–9, punctuation, and 33 non-printable control characters such as tab, newline, and carriage return.
Developed in the early 1960s and standardized in 1968, ASCII was the dominant encoding for computers and telecommunications for decades, and still forms the foundation of modern encodings such as UTF-8.
How to Use
Text to ASCII
- Select the Text to ASCII tab
- Type or paste any text into the input field
- Choose an Output Format: Decimal, Hexadecimal, Binary, or Octal
- The converted codes appear instantly with a character-by-character breakdown
- Click the Copy button to copy the result
ASCII to Text
- Select the ASCII to Text tab
- Enter decimal ASCII codes separated by spaces or commas (e.g.,
72 101 108 108 111) - The decoded text appears immediately
- Click Copy to copy the decoded result
Output Formats Explained
Decimal — The standard base-10 representation. Each character maps to a number 0–127. This is the format most ASCII tables use and the most readable for humans (e.g., A=65, space=32).
Hexadecimal — Base-16 representation using digits 0-9 and letters A-F. Commonly used in programming, memory dumps, and URL percent-encoding (e.g., A=41, space=20).
Binary — Base-2 representation using only 0 and 1. Each ASCII character occupies 8 bits (one byte) with the leading bit always 0 for standard ASCII (e.g., A=01000001).
Octal — Base-8 representation, historically used in Unix file permissions and early computing. Each standard ASCII character fits in 3 octal digits (e.g., A=101, space=040).
ASCII Table Quick Reference
| Range | Type | Examples |
|---|---|---|
| 0–31 | Control characters | NUL (0), TAB (9), LF (10), CR (13), ESC (27) |
| 32–47 | Punctuation & symbols | Space (32), ! (33), " (34), # (35) |
| 48–57 | Digits | 0 (48) through 9 (57) |
| 65–90 | Uppercase letters | A (65) through Z (90) |
| 97–122 | Lowercase letters | a (97) through z (122) |
| 127 | Control | DEL (127) |
ASCII vs. Unicode
ASCII defines only 128 characters and covers English text. Unicode extends this to over 149,000 characters from virtually every writing system worldwide.
UTF-8, the most common Unicode encoding, is designed to be fully backward-compatible with ASCII: the first 128 UTF-8 code points are identical to ASCII, stored as single bytes. Characters outside the ASCII range use 2–4 bytes in UTF-8.
This means:
- Any ASCII file is also valid UTF-8 without any conversion
- ASCII tools work correctly on the ASCII portion of any UTF-8 text
- Non-ASCII characters (e.g., accented letters, CJK, emoji) require Unicode
Common Use Cases
- Debugging — Inspect the exact byte values of a string when troubleshooting encoding issues or protocol implementations
- Network protocols — HTTP, SMTP, and many other protocols communicate via ASCII text; understanding ASCII codes helps when reading raw protocol data
- Programming — Convert between characters and their numeric codes when working with character arithmetic (e.g., checking if a character is a digit or letter)
- Data formats — Understand percent-encoding in URLs (e.g., space = %20) and escape sequences in JSON and CSV
- Education — Learn how computers represent text at the byte level
Tips
- The difference between any uppercase letter and its lowercase equivalent in ASCII is exactly 32 — flipping bit 5 toggles the case
- Digits 0–9 have ASCII codes 48–57, so subtracting 48 from the ASCII code gives the numeric value of the digit
- ASCII control characters NUL (0), LF (10), CR (13), and TAB (9) appear frequently in file formats and network protocols — knowing their codes avoids confusion when reading hex dumps