Text to ASCII code means mapping every character in a typed string to its numeric code value, with standard ASCII covering values 0 through 127. Those values can be displayed in decimal, hexadecimal, binary, or octal, so choose the notation required by your destination.
ASCII, short for American Standard Code for Information Interchange, assigns each supported character a fixed number. A space, punctuation mark, digit, and letter therefore each receive a code. The result is an ordered sequence containing one value per character, usually separated by spaces or another delimiter.
Do not confuse this character-code conversion with ASCII art. If the source is an image, the task is to arrange ordinary text symbols so they resemble that image. The Text to ASCII Art Generator handles that separate image-to-text workflow locally and produces copyable or downloadable art rather than numeric codes for a typed string.

Choose the number format you need
Decimal is the most direct representation for reading and teaching character codes. Hexadecimal is compact and commonly appears in software, configuration, and debugging contexts. Binary exposes the individual bits, while octal offers another compact grouping that is seen in some byte-oriented and legacy systems.
The underlying character does not change when you change notation. Select the format first so that every value in the finished sequence is consistent. This also prevents a common mistake: treating a decimal character code as though it were already an encoded file byte.
| Character | Decimal | Hexadecimal | 8-bit binary | Octal |
|---|---|---|---|---|
| Space | 32 | 0x20 | 00100000 | 040 |
| ! | 33 | 0x21 | 00100001 | 041 |
| 0 | 48 | 0x30 | 00110000 | 060 |
| A | 65 | 0x41 | 01000001 | 101 |
| a | 97 | 0x61 | 01100001 | 141 |
The binary column uses the familiar eight-bit byte form with a leading zero when needed. ASCII itself uses seven bits, so a separate byte representation is useful when comparing codes with data stored in eight-bit groups.
Convert text to ASCII codes step by step
For a plain ASCII string, the conversion is mechanical: identify every character, find its code, and express that code in the selected notation.
- Check that the text fits standard ASCII. ASCII covers code values from 0 through 127. Accented letters, many symbols, emoji, and other characters outside that range do not have ASCII codes. Record their Unicode code points separately and label them as Unicode rather than ASCII.
- Select the output notation. Choose decimal, hexadecimal, binary, or octal before processing the string. Keep that notation throughout the result unless you have a specific reason to split the output into multiple sections.
- Preserve every character and its order. Include spaces, tabs, line breaks, digits, and punctuation because each can occupy a character position. Decide whether the output should use spaces, commas, or newlines between values.
- Look up or calculate each value. For a local one-off in a browser's developer console, enter Array.from(prompt("Enter text")).map(ch => ch.codePointAt(0).toString(16)). Replace 16 with 10, 2, or 8 for decimal, binary, or octal. This expression returns Unicode code points; for standard ASCII input, those values are the ASCII codes. For one manual check, H is 0x48 in hexadecimal, so 4 × 16 + 8 = 72 in decimal.
- Format and verify the sequence. Compare the number of values with the number of characters, then inspect the beginning and end for omitted spaces or punctuation. If the result will be used in source code, keep it inside a quoted string or another appropriate data structure.
Tell character codes and ASCII art apart
The input determines which operation makes sense. A typed string produces a list of numeric character values. An image produces a visual arrangement of symbols that approximates shapes and brightness. These outputs may both use the word ASCII, but they are not interchangeable.
| Task | Input | Output | Typical use |
|---|---|---|---|
| Text-to-code conversion | Typed characters | One numeric code per character | Encoding discussion, references, and development fixtures |
| Image-to-ASCII conversion | A raster image | A grid of ordinary text symbols | Profile text, code comments, and terminal-inspired design |
A numeric code identifies a character; it does not recreate a picture. Conversely, ASCII art does not provide a code for every pixel in the original image. It samples the picture and chooses characters according to brightness, so it is an interpretation rather than a lossless image format.
Turn a local image into ASCII art
For the image branch, the Text to ASCII Art Generator runs the entire conversion in the current browser tab. The selected image is decoded locally, drawn to a sampling canvas, and read as pixels without being uploaded to an image service. No account, remote queue, or server-side file copy is involved.
- Choose the source image. Select a JPG, PNG, or WebP file and wait for its dimensions to appear. The supported file-size limit is 15 MB. Unsupported types and files over that limit are rejected before the browser attempts to decode them.
- Set the character width, density, and light-dark direction. Output width controls the number of character columns rather than the number of image pixels. Start near 80 columns with the Standard density set, which provides a balanced sequence. Detailed offers more tonal steps, while Simple uses fewer symbols for a bolder result. Enable Reverse when the final destination has a dark background and should show light text. The row count follows the source aspect ratio and includes a height correction for the shape of monospace characters.
- Generate, inspect, and export. Generate the art and review it in the monospace preview, where each character occupies a predictable visual cell. Use Copy to place the exact text on the clipboard, or Download TXT to save a UTF-8 plain-text file named after the source image.
After the browser reads the dimensions, a separate 40-megapixel rule limits subsequent canvas processing. That check occurs after decoding, so a highly compressed image can still place significant demand on a constrained device. Close memory-heavy tabs or use a smaller source when necessary. If an unusually tall image would produce more than 800 rows or 100,000 characters, the tool asks for a smaller width or a cropped source instead of creating an impractical block of text.
Transparent pixels are treated as if they appeared over a white background. This prevents hidden dark values inside a transparent PNG from producing unwanted marks, but transparency itself is not retained. Exact colors, fine texture, readable small text, and photographic detail will not survive in the same form as the source image.
Keep copied ASCII art aligned
Paste the result into a code block, preformatted area, or another destination that uses a monospace font. A proportional font can change character widths and break the grid, while some platforms collapse repeated spaces. Different line heights and available widths can also change the apparent proportions after pasting.
Review the final result in its actual destination, especially when using Reverse for a dark background. That setting is most suitable when the destination preserves the spaces used to position the characters. Keep the original image and test several output widths before relying on a particular version; a wider result retains more small features but creates longer lines, while a narrower result is easier to place in a constrained layout.
Handle characters outside standard ASCII
A character-code converter and an image-to-ASCII converter face different boundary issues. For typed text, anything above code 127 is outside ASCII and should be identified with a Unicode code point. For an image, the generator samples light and dark areas and maps their luminance to characters from the selected density sequence.
A Unicode code point is not automatically the same thing as a byte in a saved file. Encodings such as UTF-8 can represent characters outside ASCII using multiple bytes. Similarly, the generator's TXT download is a UTF-8 text file, but that file format does not imply that the source image was preserved without loss. Choose the operation that matches the original input: numeric codes for typed characters, or text-based art for an image.
For a deeper look, see Flip Image Explained: Horizontal vs. Vertical Mirrors.
For a deeper look, see Convert Image to ASCII Art in Python: Full Script.