ASCII Character Generator
Generate ASCII art from text or images. Convert words into banner-style character art or transform photos into text-based artwork instantly.
About
ASCII art maps visual information onto a fixed grid of printable characters from the standard 95-character ASCII set (codes 32 - 126). For text banners, each input glyph is projected onto a bitmap matrix - typically 5×7 cells - then rendered row-by-row using a fill character. For image conversion, pixel luminance L is computed per cell and quantized against an ordered density ramp of n characters sorted by visual weight. Getting the ramp wrong collapses contrast: shadows merge with midtones and detail disappears. This tool implements both modes with adjustable width, multiple font styles, and invertible ramps so the output reads correctly on both light and dark terminal backgrounds.
Limitations: bitmap fonts here approximate letter shapes at low resolution. Ligatures, CJK glyphs, and emoji are outside the supported input range. Image mode assumes uniform character cell aspect ratio of roughly 2:1 (height:width). Results depend on the monospace font used for display. Pro tip: paste output into a code block or <pre> tag to preserve spacing.
Formulas
Image-to-ASCII conversion relies on per-cell luminance quantization. Each pixel's brightness is computed using the ITU-R BT.601 luma formula:
The luminance L falls in the range [0, 255]. It is then mapped to a character index i in the density ramp string of length n:
Where R, G, B are the red, green, and blue channel values (0 - 255). L is the computed luminance. n is the length of the character density ramp. i is the index selecting the output character. When inverted mode is active, the index becomes (n − 1 − i), flipping light and dark characters.
For text banner mode, each input character is looked up in a bitmap font table. The bitmap is a 5×7 binary matrix. A 1 in the matrix emits the fill character. A 0 emits a space. Rows from all characters in the input string are concatenated horizontally with a 1-column gap to form each output line. The aspect ratio correction factor for image mode is approximately 0.5, applied to the vertical sampling rate to compensate for monospace character cells being taller than wide.
Reference Data
| Character | ASCII Code | Relative Density | Common Use |
|---|---|---|---|
| (space) | 32 | 0.00 | Background / empty |
| . | 46 | 0.05 | Very light shading |
| : | 58 | 0.10 | Light shading |
| - | 45 | 0.15 | Horizontal strokes |
| = | 61 | 0.25 | Medium-light fill |
| + | 43 | 0.30 | Medium fill |
| * | 42 | 0.40 | Star / medium-heavy |
| # | 35 | 0.60 | Heavy fill |
| % | 37 | 0.70 | Very heavy fill |
| @ | 64 | 0.85 | Darkest standard |
| $ | 36 | 0.75 | Dense vertical strokes |
| ! | 33 | 0.12 | Light vertical accent |
| / | 47 | 0.18 | Diagonal strokes |
| \ | 92 | 0.18 | Diagonal strokes |
| | | 124 | 0.20 | Vertical bars |
| ( | 40 | 0.15 | Curves |
| ) | 41 | 0.15 | Curves |
| & | 38 | 0.65 | Complex dense glyph |
| ^ | 94 | 0.08 | Caret / pointer |
| ~ | 126 | 0.10 | Wavy / water effect |
| _ | 95 | 0.12 | Floor / underline |
| < | 60 | 0.18 | Arrows / direction |
| > | 62 | 0.18 | Arrows / direction |
| [ | 91 | 0.22 | Borders |
| ] | 93 | 0.22 | Borders |