Markdown cheatsheet · Open a .md file
How to open a .md file
Someone sent you a .md file, or a README.md appeared in a folder. It is a plain text file with markdown formatting: easy to open anywhere, and one step away from looking properly formatted.
The quick answer
Any text editor opens a .md file: TextEdit on macOS, Notepad on Windows, gedit on Linux. You will see the raw text with markdown's syntax markers, like # before headings and ** around bold text. Nothing is wrong with the file; those markers are the formatting. Fine for a quick look.
# Meeting notes Talk to **Sam** about the budget. - Book the room - Send the recap
Talk to Sam about the budget.
- Book the room
- Send the recap
Seeing it formatted
To read the file the way its author intended, open it in an app that renders markdown. maxdown is a free native markdown editor for macOS, Windows and Linux; no account needed. It opens a single .md file or a whole folder of them, and renders the formatting in place as you type: the syntax only comes back when your cursor lands on a line. Download it here.
Two alternatives you may already have: VS Code ships with a markdown preview (press Cmd+Shift+V on Mac, Ctrl+Shift+V on Windows and Linux), and GitHub renders .md files in any repository, so a file that lives on GitHub is readable straight from the browser.
Setting a default app
Double-clicking a .md file opens whatever your system considers the default. Here is how to pick the app yourself, once or permanently.
macOS
Right-click the file and choose Open With to pick an app once. To make it stick, select the file and press Cmd+I (Get Info), expand Open with, choose the app, then click Change All so every .md file follows.
Windows
Right-click the file, choose Open with, then Choose another app. Pick your editor and confirm with Always (older builds show a checkbox labeled "Always use this app to open .md files").
Linux
Any editor your distribution ships will open it. To change the default, use your file manager's Open With dialog (right-click the file, or check its Properties) and mark the chosen app as the default for this file type.
Common questions
Is a .md file safe to open?
Yes. It is plain text: no macros, no scripts, no executable content. Opening one displays text and nothing else runs.
.md or .markdown?
The same format. .md is the common extension; .markdown, .mdown and .mkd turn up occasionally, and markdown apps generally treat them all the same.
How do I turn it into a PDF or web page?
Render it, then export. See markdown to PDF and markdown to HTML for the options, including maxdown's built-in export to styled HTML or PDF.
Going further
Four guides pick up where this one stops, depending on where you're stuck: