What is Mermaid ASCII?

Updated

Mermaid ASCII is a tool that converts Mermaid diagram code into ASCII text diagrams. You paste or type Mermaid syntax into the "Mermaid Code" area, and it renders the result as plain-text ASCII in the "ASCII Output" area. The current version shown on the site is v1.6.1. It is useful when you need a diagram that survives in environments where images or rendered SVG won't display — plain text files, terminal output, code comments, or chat messages.

How it works

The tool takes standard Mermaid graph definitions and lays them out using ASCII characters. You control the spacing with two settings visible on the page:

  • xPadding (shown as 5) — horizontal spacing between elements
  • yPadding (shown as 3) — vertical spacing between elements
  • Use extended characters — a toggle for richer box-drawing characters instead of basic ASCII

The page includes several worked examples you can inspect directly:

  • Nested subgraphs
  • Labelled arrows
  • Styled text
  • Sequence diagrams

Each example pairs the Mermaid source with its ASCII output, so you can see exactly how a given construct translates before writing your own.

Using the web interface

  1. Enter Mermaid code in the Mermaid Code field. For example: graph LR\nABC --> DEF
  2. Adjust xPadding and yPadding if the default spacing doesn't suit your target width.
  3. Toggle Use extended characters if you want box-drawing glyphs rather than plain ASCII.
  4. Read the result in ASCII Output and use the Copy button to take it elsewhere.

The expected result is a text rendering of your graph that preserves direction and labels, sized according to your padding settings.

Alternative usage methods

The site notes that the same Git repository (AlexanderGrooff/mermaid-ascii) supports other ways to generate output.

cURL request — send Mermaid code to the service and get ASCII back:

curl https://mermaid-ascii.art -d mermaid="graph LR\nABC --> DEF"

Run the Golang tool locally — clone the repo and run it against a file:

git clone https://github.com/AlexanderGrooff/mermaid-ascii
cd mermaid-ascii
go run main.go -f test.mermaid

The local route needs a Go toolchain installed and a .mermaid file containing your diagram. The cURL route needs no local setup but depends on the hosted service being reachable.

When to choose it

Use Mermaid ASCII when the destination can only hold plain text — README files rendered without image support, terminal logs, commit messages, or documentation that must stay diff-friendly. If your target renders Mermaid natively or accepts images, a normal Mermaid renderer will give you cleaner output with less manual spacing tuning. The padding controls and extended-character toggle exist precisely because ASCII layout is width-sensitive, so expect to adjust them for narrow terminals or fixed-width documents.