Developer Tools

Markdown in the Terminal: Glow, mdcat and More

Render Markdown inside your terminal with Glow, mdcat, mdless or Frogmouth, or convert it with Pandoc. Commands, trade-offs and when a browser preview is easier.

Markdown in the Terminal: Glow, mdcat and More
All Guides Open Editor

Quick Summary

Render Markdown inside your terminal with Glow, mdcat, mdless or Frogmouth, or convert it with Pandoc. Commands, trade-offs and when a browser preview is easier.

If you read documentation over SSH, or you simply live in a terminal, you do not need to leave it to read a .md file. A few small tools render headings, lists, code blocks and tables right where you are. Here is what each one does and how to run it.

Quick comparison

ToolStyleBest for
GlowRendered output, pager and a file browserEveryday reading, nice themes
mdcatPrints rendered Markdown, like catScripts and quick looks; inline images in some terminals
FrogmouthFull-screen reader with history and bookmarksBrowsing a set of docs
mdlessless-style readerPeople who like less
PandocConverter, not a viewerProducing HTML, plain text or PDF

Glow

Glow, from Charm, renders Markdown with colors and a style that matches your terminal.

glow README.md        # render one file
glow                  # browse Markdown files in the current folder
glow -p README.md     # open in a pager
glow -s dark README.md

It is available through Homebrew, winget, Scoop and many Linux package managers. If your distribution does not package it, follow the install instructions on the project page.

mdcat

mdcat behaves like cat for Markdown. It prints rendered text and, in terminals that support it (such as iTerm2, Kitty and WezTerm), can show images inline.

mdcat README.md
mdcat --paginate README.md

Frogmouth

Frogmouth is a Markdown browser for the terminal with navigation history, bookmarks and a table of contents. It is a Python application, so it installs well with pipx.

pipx install frogmouth
frogmouth README.md

mdless

mdless is a Ruby gem that renders Markdown and pages it like less.

gem install mdless
mdless README.md

Pandoc for conversion

Pandoc does not display Markdown itself, but it converts it:

pandoc README.md -t plain | less
pandoc README.md -o README.html

When a terminal is not enough

Wide tables wrap badly, and images only work in some terminals. For a document that depends on tables or pictures, copy the file to your desktop and open it in the online Markdown viewer. For desktop apps, see Markdown viewers for Linux, for Mac and for Windows.

Questions

How do I read a Markdown file on a remote server?

Install Glow or mdcat on the server, or copy the file to your own machine with scp and read it there.

Is there a viewer with syntax-highlighted code blocks?

Glow and mdcat both highlight fenced code blocks that name a language.