What is a .md file?
Markdown · Code and data · John Gruber · 2004
Markdown (.md) is a plain-text way to write formatted documents using simple marks, like # for a heading and * for emphasis. It reads fine as-is and turns into clean HTML, which is why READMEs, notes and docs use it.
What is a .md file used for?
Markdown adds light formatting to plain text with a handful of symbols: # for headings, ** for bold, - for lists, and [text](url) for links. The raw file is still perfectly readable.
It was designed to convert cleanly to HTML, so the same .md renders as a nicely formatted page on GitHub, in documentation sites and in note apps.
You can open and edit an .md in any text editor. A Markdown editor such as VS Code, Obsidian or Typora also shows a live preview of how it will look.
Because it is just text with a few marks, Markdown is safe and future-proof.
How to open a .md file
The .md format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list.
Windows
- Any text editor
- VS Code
- Obsidian / Typora (preview)
macOS
- Any text editor
- VS Code
- Obsidian / Typora
Linux
- Any text editor
- VS Code
Web
- GitHub and many sites render Markdown
How to convert a .md file
You can convert a .md file to HTML, PDF, DOCX using a conversion tool or the export menu of an app that opens it.
.md file signature (magic bytes)
Programs recognise a .md file by the bytes at the start of the file, not by its name. These are the signatures for MD.
| Hex signature | Offset | Note |
|---|---|---|
| (no fixed signature) | 0 | plain text; no fixed signature |
See the full magic-numbers reference for every format.
Frequently asked questions
What is a .md file?
Markdown (.md) is a plain-text way to write formatted documents using simple marks, like # for a heading and * for emphasis. It reads fine as-is and turns into clean HTML, which is why READMEs, notes and docs use it.
How do I open a .md file?
Open it in any text editor to read or edit the raw text. For a formatted preview, use VS Code, Obsidian or Typora, or view it on a site like GitHub that renders Markdown.
How do I convert Markdown to PDF or Word?
Use a Markdown editor's export option, or a tool like Pandoc, which converts .md to PDF, DOCX and HTML from a single command.
Related formats
Sources
Details on this page were checked against authoritative references: