IMAGE TOOL

Image to ASCII Art Converter

Pick an image and turn it into text art made of characters. Adjust the width and character set, then copy it or download it as a .txt file.


  

About this tool

ASCII art draws a picture using ordinary text characters: dense characters such as @ and # stand in for dark areas, and light ones such as . and spaces for bright areas. This converter does it automatically — it shrinks your image to a grid, measures how bright each cell is, and swaps each cell for a character of matching density. The image is processed in your browser with the Canvas API and is never uploaded.

How to use the Image to ASCII Art Converter

  1. Choose an image. Photos work, but high-contrast pictures — logos, silhouettes, line art, portraits against a plain background — give the clearest results.
  2. Set the width in characters. Around 60–80 fits a code comment or chat message; 150 or more keeps far more detail but needs a wide window to view.
  3. Pick a character set and tick Invert if the art will be shown as light text on a dark background, such as a terminal.
  4. Copy or download the result. Paste it somewhere that uses a monospaced font, or the shape will be distorted.

How the conversion works

First, the image is resized to the width you chose, in characters. Characters are roughly twice as tall as they are wide, so the height is halved to stop the picture looking stretched: an 800 × 600 pixel photo at 100 characters wide becomes 100 × 38 characters (600 ÷ 800 × 100 × 0.5 = 37.5, rounded to 38). Each cell's brightness is then worked out from its red, green and blue values, weighted the way the eye perceives them — green counts most and blue least (0.299 R + 0.587 G + 0.114 B). Transparent areas are treated as white. Finally, the brightness from 0 (black) to 255 (white) is split into as many equal bands as there are characters in the set, and each cell gets the character for its band.

Choosing a character set

Worked example

Take a black logo on a white background, 800 × 600 pixels, at 100 characters wide with the Standard set. The output is 38 lines of 100 characters. Cells that land fully on the black logo have brightness 0 and become @; the white background has brightness 255 and becomes a space; the anti-aliased edge pixels fall in between and become characters such as +, = and :, which gives the outline a smooth edge. Tick Invert for a terminal with a black background, and the mapping flips: the logo turns into spaces and the background fills in with @, so the logo appears in the background colour.

Getting better results

Common uses

Which brightness becomes which character

With the Standard set, the 256 possible brightness values are split into ten equal bands, and each band gets one character. These are the exact ranges the converter uses, before Invert is applied:

Brightness (0 to 255)Character
0 to 25@
26 to 51%
52 to 76#
77 to 102*
103 to 127+
128 to 153=
154 to 179-
180 to 204:
205 to 230.
231 to 255space

A mid-grey pixel such as rgb(140, 140, 140) lands on =, and anything from 231 up to pure white becomes a space. With Invert on, the brightness is flipped (255 minus the value) before the lookup, so white becomes @. The Detailed set works the same way with 70 narrower bands, and Binary uses three: 1, 0 and a space.

Is it really ASCII?

ASCII defines 128 codes, of which 95 are printable: the space plus the 94 visible characters from ! to ~. The Standard, Detailed and Binary sets use only those characters, so the output survives any system that handles plain text. The Blocks set is different: █ ▓ ▒ ░ are Unicode characters U+2588 FULL BLOCK, U+2593 DARK SHADE, U+2592 MEDIUM SHADE and U+2591 LIGHT SHADE, from the Block Elements range. They need UTF-8 or another Unicode encoding. The downloaded .txt file is saved as UTF-8, but a program that assumes an older single-byte encoding will show them as garbled symbols.

Pasting the result without breaking it

To shrink or crop the source image first, use the Image Resizer.

Frequently asked questions

Is my image uploaded to a server?

No. The image is read and converted in your browser using the Canvas API, and nothing is sent anywhere.

Why does my ASCII art look stretched or squashed?

Text characters are about twice as tall as they are wide, so the converter halves the height to compensate. It will only look right in a monospaced font; in a proportional font the columns drift and the shape distorts.

What width should I choose?

Around 60 to 80 characters fits a chat message or code comment. Higher widths keep more detail but need a wider window or a smaller font to view.

What does Invert do?

It reverses the mapping so bright areas get dense characters. Use it when the art will be shown as light text on a dark background, such as a terminal.

Which images work best?

High-contrast images such as logos, silhouettes and portraits against a plain background. Busy photos with lots of mid-tones tend to turn into an even texture.

How do I put ASCII art in a GitHub README?

Paste it inside a fenced code block: a line with three backticks, then the art, then another line with three backticks. GitHub renders code blocks in a monospaced font and keeps every space, so the columns line up. Without the code block, repeated spaces collapse and the image distorts.

Why do the block characters show as strange symbols?

The shade characters in the Blocks set are Unicode, not ASCII. If a program opens the file with an older single-byte encoding instead of UTF-8, it shows them as garbled symbols. Open the file as UTF-8, or pick the Standard set for plain ASCII output.