ASCII Art Editor - Draw, Edit & Export Text Art Online
Free online ASCII art editor with drawing tools, flood fill, line & rectangle tools, undo/redo, and export to TXT or clipboard. No signup required.
About
ASCII art encodes visual information within a fixed-width character grid, typically 80ร40 cells. Each cell maps to a single glyph from the printable ASCII range (0x20 - 0x7E). The visual density of a character determines its perceived brightness: @ registers as near-black while . reads as near-white. Getting character density wrong collapses contrast and produces unreadable output. This editor provides Bresenham-based line rasterization, BFS flood fill, and rectangular selection so you work at the glyph level without guessing pixel alignment. Grid state persists to LocalStorage automatically.
The tool approximates a bitmap editor but operates in discrete character space. Diagonal lines exhibit staircase artifacts inherent to low-resolution grids. For best results, work at grid widths above 60 columns and use high-density characters (#, @, M) for foreground and low-density characters (., ยท, ) for background. Export assumes a monospace font at 12px line height.
Formulas
The editor uses Bresenham's line algorithm to rasterize straight lines between two grid coordinates. Given start point (x0, y0) and end point (x1, y1), the algorithm steps through the major axis and accumulates error to decide when to step on the minor axis.
dy = โ|y1 โ y0|
err = dx + dy
Loop: if 2err โฅ dy โ err += dy, x += sx
if 2err โค dx โ err += dx, y += sy
The flood fill uses Breadth-First Search. Starting from cell (x, y), it enqueues all 4-connected neighbors that match the target character and replaces them with the fill character. Worst-case time complexity is O(W ร H) where W and H are grid width and height.
Where dx = horizontal distance, dy = vertical distance, err = accumulated error, sx = step direction on x-axis (+1 or โ1), sy = step direction on y-axis.
Reference Data
| Character | Hex Code | Relative Density | Common Use |
|---|---|---|---|
| @ | 0x40 | 0.95 | Maximum fill / dark regions |
| # | 0x23 | 0.90 | Walls, borders, dense fill |
| M | 0x4D | 0.85 | Heavy shading |
| W | 0x57 | 0.83 | Heavy shading alternate |
| % | 0x25 | 0.70 | Medium-dark texture |
| & | 0x26 | 0.68 | Medium shading |
| * | 0x2A | 0.50 | Stars, medium fill |
| + | 0x2B | 0.40 | Crosshairs, joins |
| = | 0x3D | 0.38 | Horizontal lines, water |
| - | 0x2D | 0.25 | Horizontal lines |
| | | 0x7C | 0.25 | Vertical lines, pipes |
| / | 0x2F | 0.22 | Diagonal lines (right-leaning) |
| \ | 0x5C | 0.22 | Diagonal lines (left-leaning) |
| : | 0x3A | 0.18 | Light vertical texture |
| ; | 0x3B | 0.17 | Light texture |
| , | 0x2C | 0.10 | Very light shading |
| . | 0x2E | 0.08 | Minimal fill, highlights |
| ` | 0x60 | 0.05 | Near-white accent |
| (space) | 0x20 | 0.00 | Empty / background |
| ~ | 0x7E | 0.30 | Water, waves |
| ^ | 0x5E | 0.15 | Mountains, carets |
| _ | 0x5F | 0.12 | Underlines, ground |
| ! | 0x21 | 0.30 | Exclamation, rain |
| " | 0x22 | 0.20 | Light texture pairs |
| ' | 0x27 | 0.07 | Apostrophe, minimal mark |