ASCII Text Converter

JJ Ben-Joseph headshot JJ Ben-Joseph

ASCII Character Codes: Letters as Numbers

ASCII character conversion connects the letters, punctuation, and symbols people type with the numeric values software can process. ASCII, short for American Standard Code for Information Interchange, was established for teletypes and early computers and assigns the original character set values from 0 through 127. UTF-8 preserves those same first 128 values, so ordinary ASCII text has the same numeric codes in both systems.

For example, the capital letter “A” has decimal code 65, hexadecimal code 41, and binary representation 1000001. Its binary place values confirm that 26+20=65. This ASCII converter shows decimal and hexadecimal values for each entered character, while its reverse field turns entered numeric codes back into characters.

ASCII Decimal, Hexadecimal, and Binary Representations

ASCII codes can be written in decimal, binary, or hexadecimal. Decimal uses base 10, binary uses base 2, and hexadecimal uses base 16, with one hex digit representing four binary bits. For the ASCII value 65, division by 16 gives 65=4×16+1. The quotient 4 and remainder 1 form hexadecimal “41.”

ASCII hexadecimal decoding uses positional weights. For a two-digit hexadecimal value ab, its decimal value is 16×a+b. Thus 0x4F is 16×4+15=79, the code for capital “O.” More generally, a quotient and remainder satisfy n=q×16+r, where the remainder becomes the final hexadecimal digit. The decoder accepts both decimal tokens and hexadecimal tokens beginning with 0x.

Common ASCII Character Code Table

This ASCII reference table lists decimal and hexadecimal values for several letters and digits that are useful when checking an encoded message.

CharacterDecimalHex
A650x41
B660x42
C670x43
a970x61
b980x62
c990x63
0480x30
1490x31
2500x32

These ASCII entries show useful ranges: uppercase letters are 65–90, lowercase letters are 97–122, and digits are 48–57. The uppercase range can be expressed as 65code90, while digits satisfy 48code57. In the English alphabet portion of ASCII, subtracting 32 changes a lowercase letter code to its uppercase equivalent: codeupper=codelower32.

ASCII Control Characters and Invisible Codes

ASCII control characters occupy codes 0–31 rather than displaying as ordinary symbols. They were designed to control communications and formatting; familiar examples include carriage return 13 and line feed 10. Their usual paired order in a carriage-return/line-feed sequence is CR=13,LF=10. In raw data these may be represented as \r\n. When encoding text, this converter reports their numeric values just as it does printable characters; decoding one can create an invisible or formatting character in the output.

ASCII Compatibility with Unicode and UTF-8

ASCII conversion remains useful because ASCII is the shared beginning of UTF-8. Unicode provides many more characters than ASCII, while UTF-8 encodes values 0–127 with the corresponding single-byte ASCII values. For an ASCII value n{0,,127}, the UTF-8 byte value is likewise UTF8(n)=n. Consequently, ASCII text is valid UTF-8, but text containing characters outside that range is not ASCII.

This page’s browser code uses JavaScript character-code functions rather than enforcing an ASCII-only range. It can therefore display UTF-16 code-unit values for non-ASCII input and create characters from entered numeric values, but those results are not a UTF-8 byte decoder. In particular, non-BMP Unicode characters require more than one UTF-16 code unit, so use a dedicated Unicode or UTF-8 tool when byte-level Unicode conversion is required.

How the ASCII Character Conversion Works

The ASCII character mapping associates each member of the original ASCII set with an integer. If T is that character set and N is the set {0,…,127}, ASCII defines a bijection f:TN. Its inverse f−1 maps an ASCII number back to its character.

In this converter, charCodeAt() supplies the numeric code used for each entered character, corresponding to code=charCodeAt(ch,0), and String.fromCharCode() creates output characters from parsed values, corresponding to ch=fromCharCode(code). Those JavaScript functions work across the UTF-16 code-unit range, which is why the interface can produce values beyond ASCII even though the ASCII explanations and reference table focus on 0–127.

ASCII Code History and Lasting Relevance

ASCII grew out of telegraph and teletype conventions and originally used seven bits, leaving room in an eight-bit transmission unit for parity checking. The seven-bit range contains 27=128 possible values. Later systems used many incompatible eight-bit extensions, while Unicode became the broader standard for international text.

ASCII character codes still appear in programming, protocol headers, serial devices, logs, configuration formats, and debugging output. Recognizing the difference between a character such as “1” and its code 49 can prevent errors when a system expects bytes or numeric commands.

Practical ASCII Encoding and Decoding Uses

ASCII conversion is especially helpful when examining serial data. A device receiving the characters “1 0 0” receives the codes 49,32,48,32,48, including the spaces; that differs from receiving one numeric byte with value 100. Paste a space-separated sequence into the decoder to inspect the characters it represents.

ASCII hexadecimal values also clarify familiar web notation. The less-than sign “<” is decimal 60 and hexadecimal 0x3C, while a space is decimal 32 and is commonly percent-encoded as %20. URL percent-encoding is not identical to this converter’s output format, but the hexadecimal character value is the connection between them.

ASCII Converter Limitations and Extensions

This ASCII text converter accepts plain text for code display and accepts whitespace-separated decimal or 0x-prefixed hexadecimal values for decoding. It does not parse escape notation such as \x41, interpret UTF-8 byte sequences, or show binary output. Its use of JavaScript character-code functions also means it is best viewed as a character-code utility rather than a strict validator of the 7-bit ASCII standard.

ASCII Converter Accessibility and Interface Choices

The ASCII converter keeps encoding and decoding in separate labeled text areas so the direction of conversion is clear. Its results use a monospaced output area, making a sequence of decimal and hexadecimal codes easier to scan. The calculator itself runs in the browser and does not submit the entered text through a form action.

Using This ASCII Text Converter

To encode text as character codes, type or paste it into the first text area and select Convert to ASCII. Each character is shown as a decimal value followed by hexadecimal notation in parentheses, such as “72(0x48) 101(0x65).” To decode, enter space-separated decimal codes or 0x-prefixed hexadecimal codes in the second text area and select Convert to Text.

Try a short word, compare uppercase and lowercase values, or inspect a sequence captured from a device. Checking each code against the character you expect is the most reliable way to distinguish text data from numeric byte values.

ASCII codes will appear here.
Decoded text will appear here.

ASCII Signal Cipher Sprint

Steady the signal cursor on the right ASCII code before the next transmission window closes. Each hit locks a character into memory and turns decimal into instinct.

Target CharacterA
Target Code65
Signal Code65
Streak0.0s
Time Left80s
Score0

Tap or drag to move the signal. Keyboard: ← → to nudge, space to stabilize drift, Esc to pause. Glitch windows boost points.

Play for 80 seconds by keeping the signal aligned with the target ASCII code band. Use touch or mouse drag to move, arrow keys to nudge, space to stabilize, and Escape to pause or resume.