How to Convert Mermaid Code to ASCII Output on mermaid-ascii.art

Updated

Paste your Mermaid diagram code into the Mermaid Code box on mermaid-ascii.art, and the ASCII Output panel updates with the text version of your diagram. You can then use the Copy button to grab the result. The site runs Mermaid ASCII v1.6.1 and works for anyone who needs a plain-text diagram for a terminal, README, code comment, or chat message where rendered graphics won't show.

Steps to convert a diagram

  1. Open mermaid-ascii.art in your browser.
  2. In the Mermaid Code area, type or paste valid Mermaid syntax. For example:
    graph LR
    ABC --> DEF
    
  3. Watch the ASCII Output area. It regenerates as you edit, showing the diagram drawn with text characters.
  4. Adjust the layout controls if the default spacing looks cramped or too loose:
    • xPadding — horizontal spacing (shown as 5 by default in the interface).
    • yPadding — vertical spacing (shown as 3 by default).
    • Use extended characters — toggle for richer box-drawing glyphs instead of basic ASCII.
  5. Click Copy to put the ASCII output on your clipboard.

The expected result is a block of monospaced text that mirrors your graph's structure and labels, ready to paste anywhere plain text is accepted.

What kinds of diagrams you can try

The site ships with several examples you can load or imitate:

  • Example 1: Nested Subgraphs — diagrams with grouped nodes.
  • Example 2: Labelled Arrow — edges that carry text labels.
  • Example 3: Styled Text — nodes using styling syntax.
  • Example 4: Sequence Diagram — message-passing diagrams, not just flowcharts.

If your diagram doesn't render as expected, the most common cause is invalid Mermaid syntax rather than a problem with the converter. Check that arrows, node brackets, and subgraph blocks are closed correctly.

Alternative ways to generate the same output

The same Git repository (AlexanderGrooff/mermaid-ascii) offers two non-browser methods.

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

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

Run the Go program 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

Use the web interface when you want a quick visual check and manual copy. Use cURL or the CLI when you need to script the conversion or run it inside a build pipeline.

Choosing between the options

Method Best for Requires
Web interface One-off conversions, tweaking padding visually A browser
cURL Automating conversion in scripts Network access to the endpoint
Go CLI Local, offline, or CI use Go toolchain and the cloned repo

If you only need to convert a diagram occasionally, the web page is the fastest path. If the conversion is part of a repeatable process, the cURL or CLI route avoids manual copying.