Character encoding tool

Text to ASCII Converter

Convert standard ASCII text into decimal character codes from 0 through 127. Boundary whitespace is trimmed; interior whitespace is encoded.

Text input

Enter ASCII text

ASCII 0–127
Up to 1,000 ASCII characters. Spaces, punctuation, and line breaks each have their own code.
Decimal code sequence

ASCII values

The ASCII codes will appear here

Enter text made of standard ASCII characters.

What Is Text to ASCII Encoding?

The Text to ASCII Converter maps standard ASCII text to decimal character codes from 0 to 127. Enter up to 1,000 characters and read a space-separated list of their codes. Uppercase letters, lowercase letters, digits, punctuation and interior whitespace each have their own values.

This page encodes text into codes; the related ASCII to Text tool performs the reverse operation. Only standard ASCII characters are accepted. Accented letters, emoji and typographic quotation marks are rejected rather than transliterated. Leading and trailing whitespace is trimmed before conversion, so this is not a lossless byte-preservation tool.

How to Convert Text to Decimal ASCII Codes

  1. Enter your message in Text. Use ordinary ASCII letters, digits, punctuation and any interior spaces or line breaks you need.
  2. Keep the text within the 1,000-character input limit. A copied curly quote or nonbreaking space can make otherwise familiar-looking text fall outside standard ASCII.
  3. Check the ends of the text. The site removes leading and trailing whitespace before validation and encoding. An entry made entirely of spaces is therefore not a valid message here.
  4. Select Convert to ASCII. Read the main Decimal ASCII codes result.
  5. Match each returned token with one character in the processed text. An interior space becomes 32; the spaces between output numbers are only separators.

No hexadecimal, binary or octal output selector is available. This page has no file upload, encoding detector, live character table or Unicode code-point mode. If you need exact preservation of boundary spaces or control bytes, use a tool designed for that task.

Text to ASCII Mapping Rules

Output codes = decimal ASCII value of each processed text character, in order

Interior space → 32; horizontal tab → 9; line feed → 10

This conversion uses a character table rather than multiplication. RFC 20’s standard ASCII table gives the seven-bit mapping and control characters. Letter case matters because uppercase and lowercase letters occupy different positions.

After input preparation and range validation, the controller splits the accepted ASCII text into single-byte characters and applies PHP’s ord function to each. It joins the resulting decimal values with one ordinary space. The function itself can inspect other bytes, but this page rejects characters outside ASCII first.

Laravel’s input-normalization documentation describes the trimming applied before this controller runs. The current site does not exempt this text field. Interior whitespace stays part of the encoded message; boundary whitespace does not. This behavior comes from the application, not from the ASCII standard.

Text Input, Decimal Codes and Separators

Text
An ASCII-only text entry, with a 1,000-character form limit. Boundary whitespace is removed before conversion; interior whitespace remains.
Decimal ASCII codes / Space-separated codes
The same ordered decimal-code sequence in the main result card. One token corresponds to each character after input processing.
Output separators
Ordinary spaces between numeric tokens. They make the code list readable and are different from the value 32 that represents a space in the message.

Text to ASCII Conversion Example

Illustrative example. Enter Log 7?. The six characters are L, o, g, an interior space, 7 and ?. Their decimal codes are 76, 111, 103, 32, 55 and 63.

The displayed sequence is 76 111 103 32 55 63. Notice that the character 7 becomes 55. The converter encodes the written digit; it does not treat that digit as an instruction to output code 7.

Change uppercase L to lowercase l and the first code becomes 108. Remove the interior space and token 32 disappears. Extra spaces between the output numbers do not replace a missing encoded space.

Calculation check. An independent character-code lookup and the endpoint agree. The examples use plain ASCII. Leading or trailing whitespace is deliberately excluded so the example’s six characters match the text that reaches the encoder.

Example comparison. The cases below use the same conversion rules.

Illustrative plain ASCII messages and decimal output codes
TextDecimal codes
Log 7?76 111 103 32 55 63
log 7?108 111 103 32 55 63
Log7?76 111 103 55 63

Whitespace, Letter Case and ASCII Limits

Interior whitespace is encoded; boundary whitespace is trimmed. The distinction comes from the site’s input processing. ASCII assigns codes to spaces and controls, but does not itself require removing them.

How selected inputs reach the encoder
Entered text or characterEffectDecimal output
Space + A + spaceBoundary spaces removed65
A + two spaces + BInterior spaces retained65 32 32 66
A + tab + BInterior tab retained65 9 66
A + line feed + BInterior line feed retained65 10 66
Spaces onlyEmpty after trimmingRejected

Plain punctuation and typographic alternatives can look similar while belonging to different character sets. A straight quote and a hyphen-minus are ASCII; a curly quote and an em dash are not. The page rejects unsupported characters instead of replacing them without your knowledge.

A decimal output token can contain more than one digit, yet still represent one text character. For example, 76 identifies uppercase L. Read the sequence token by token rather than grouping its digits into words or assuming that its length is the original text length.

How to Read the ASCII Code Sequence

Read the output as decimal codes in text order. Tokens do not describe separate words or numerical magnitudes in the message. A code such as 111 represents one character, while a message containing the three visible digits 111 would produce three tokens, each equal to 49.

Interior whitespace also receives codes. A line feed between A and B gives 65 10 66, while a tab between them gives 65 9 66. A browser form submission can normalize a typed line break to carriage return plus line feed, producing 13 10. A literal line feed submitted without that normalization produces 10. Read the returned sequence rather than assuming one code per visible line break.

Case and punctuation distinguish messages. Plain double quotes are ASCII, but curly quotation marks are not. A hyphen-minus is ASCII, while an en dash or em dash is outside the accepted set. Replace a character only if you intend to change the message; the converter does not silently normalize it.

Encoding a message is not encrypting it. ASCII codes follow a public mapping, and the sequence does not conceal the text. The tool also does not identify a file’s original encoding or compute a Unicode code point.

A round trip through ASCII to Text can reproduce the processed ASCII characters, but cannot restore whitespace removed at the beginning or end. Keep your original text if that boundary information matters. The decoded result is a character sequence, not proof that the unprocessed input survived unchanged.

Common Text to ASCII Mistakes

  • Pasting accented letters, emoji, curly quotes or nonbreaking spaces.
  • Expecting a typed digit to keep its numeric value as an ASCII code.
  • Confusing separators between code tokens with code 32 inside the message.
  • Assuming leading and trailing spaces are preserved.
  • Expecting hexadecimal or binary output from a decimal-only encoder.
  • Calling ASCII encoding encryption.
  • Treating a successful round trip as proof that boundary whitespace survived.

Text to ASCII Questions

How do I convert text to ASCII codes here?

Enter standard ASCII text and select Convert to ASCII. The page lists each processed character’s decimal code in order, separated by spaces.

Does it preserve spaces at the start and end?

No. The site trims boundary whitespace before conversion. Interior spaces remain and become code 32; an all-space entry is rejected.

What happens to an interior tab or line break?

An interior tab becomes decimal 9. A literal line feed is 10, while browser form submission can send a line break as carriage return plus line feed, or 13 10. Interior controls remain part of the message.

Why does the digit 7 become 55?

The character 7 occupies decimal position 55 in ASCII. Encoding a written digit is different from entering a character-code number.

Do uppercase and lowercase letters have different codes?

Yes. For example, uppercase L is 76 and lowercase l is 108. The converter keeps that distinction.

Can it encode emoji or accented letters?

No. They are outside standard ASCII. This tool rejects them and does not substitute Unicode code points or transliterated letters.

Can I choose binary or hexadecimal output?

No. The output is decimal codes with spaces between them. There is no output-base or separator selector.

Is converting text to ASCII a form of encryption?

No. It uses a public character mapping. The related decoder can read the code sequence, and boundary whitespace removed before encoding cannot be recovered.

Sources and References