CodeApr 27, 2026 · Updated Oct 12, 2026 · 4 min read

How to Create ASCII Diagrams for Code Documentation (2026)

Draw boxes, arrows, and flowcharts in plain text for README files, code comments, and pull request descriptions. Free ASCII diagram editor.

{ }
Try the ASCII Diagram Editor
Free, no signup
→
DG
Derek Giordano
Designer & Developer
In this guide
01What Are ASCII Diagrams?02When to Use ASCII Art Over Images03Using the ASCII Diagram Editor04Common Diagram Patterns05Why a diagram that looks right can misalign
⚡ Key Takeaways
  • Text diagrams sit next to the code, show up in diffs and never lose an image link.
  • Most “ASCII” diagrams are really Unicode box drawing; strict ASCII uses + - |.
  • Box-drawing characters are East Asian Ambiguous width and can misalign in CJK terminals.
  • On GitHub, use a code block for text diagrams, or Mermaid for larger diagrams rendered as graphics.
  • Keep diagrams under 80 columns.

What Are ASCII Diagrams?

ASCII diagrams are pictures made of text characters, so they live in the same file as the code they describe. Strictly, ASCII means the 95 printable ASCII characters (space through tilde), and classic diagrams use only +, -, |, / and \. Most diagrams people call “ASCII” today, including this editor’s output, use Unicode instead: box-drawing characters from U+2500–U+257F (┌─┐│└┘) and arrowheads from the Geometric Shapes block (▲ ▼ ◄ ►). Either way the diagram is plain text: it is searchable, shows up in diffs, and cannot break because an image link died.

When to Use ASCII Art Over Images

Text diagrams earn their place where an image cannot go or would drift out of date: code comments, commit messages, terminal output and CLI help, and design notes that should change in the same pull request as the code. In a README or a GitHub issue you now have a second option: GitHub has rendered Mermaid diagrams from fenced mermaid code blocks since February 2022, so flowcharts, sequence diagrams and state machines can be written as text and displayed as graphics. Mermaid is the better choice when the diagram has more than a handful of boxes or needs to be read by people who never open the source file; a text diagram is the better choice when it has to read correctly in an editor, a terminal or a plain-text email.

Using the ASCII Diagram Editor

The editor has six tools: Box, Line, Arrow, Draw (a solid █ block), Erase and Text. Drag with Box, Line or Arrow to place a shape; lines and arrows bend once, in an L. Text puts one character in each cell. The canvas is 60 columns by 30 rows, and Copy ASCII trims trailing spaces from every line and blank lines from the end, so the pasted block is no wider than what you drew. Two behaviors to plan around: a line drawn across a box edge overwrites the border rather than making a junction (┼ ├ ┬), so draw boxes last or retype junctions with Text, and an L-shaped line dragged from right to left currently puts its corner the wrong way round, which one retyped character fixes.

Common Diagram Patterns

The most common text diagram is a row of boxes joined by arrows: client, API, database. File trees use ├── and └── (the style the tree command prints). Sequence diagrams put each participant in a column with a vertical line beneath it and horizontal arrows between them; state machines are boxes joined by labeled arrows. There is no diamond tool, so draw decision points as boxes with labeled branches, or type / and \ with the Text tool. Keep the width under 80 columns, the classic terminal width, so the diagram does not wrap in a split diff or a narrow terminal.

Why a diagram that looks right can misalign

A text diagram depends on every character taking exactly one column. Two things break that. The first is a proportional font: outside a code block, Markdown renders text in the page font and every box collapses, which is why diagrams go between triple backticks. The second is subtler. Unicode’s East Asian Width property (UAX #11) marks every box-drawing character from U+2500 to U+254B, the arrows ← ↑ → ↓ and the triangles ▲ ▼ as Ambiguous: narrow in Western contexts, but often drawn two columns wide by terminals and editors configured for Chinese, Japanese or Korean. In such a setup the box edges double in width while spaces and Latin letters do not, so the right side of every box drifts. If your readers may use a CJK locale, or the target is strict ASCII, draw with +, - and |, which are always narrow. (Character classes checked against EastAsianWidth.txt from Unicode 18.0.0 on October 12, 2026.)

Frequently Asked Questions

What characters are used in ASCII diagrams?+
Classic ASCII diagrams use only + - | / and \. Most modern ones, including this editor’s output, use Unicode box-drawing characters (┌ ─ ┐ │ └ ┘) and arrowheads from the Geometric Shapes block (▲ ▼ ◄ ►). The editor always writes Unicode; for strict ASCII, type + - | with the Text tool.
Will ASCII diagrams render in GitHub README files?+
Yes. Wrap them in a code block (triple backticks) in Markdown. GitHub renders code blocks in a monospaced font, which preserves the alignment. Without a code block, proportional fonts will misalign the characters.
What is the maximum width for ASCII diagrams?+
There is no rule, but 80 columns is the classic terminal width and still the safe choice for code comments, split diffs and narrow terminals. The ASCII Diagram Editor canvas is 60 columns by 30 rows, and Copy ASCII trims the trailing space so the pasted diagram is only as wide as your drawing.
Try it yourself

Use the ASCII Diagram Editor — free, no signup required.

⚡ Open ASCII Diagram Editor
⚡ Try the free Analytics Dashboard Mockup →
⚡ Try the free Quick Chart Builder →