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.
What opens 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
Open a .md file step by step
- Confirm the file really is a .md. Drop it into the WhatFileType identifier, which reads its signature in your browser without uploading anything.
- On Windows, open it with Any text editor or VS Code.
- On Mac, use Any text editor or VS Code.
- On Linux, try Any text editor or VS Code.
- Still stuck? Convert the .md to HTML, which opens more widely.
Why can't I open my .md file?
Almost always because no installed app understands MD. Install one of the apps above, or convert the file to a format your existing software already reads. If double-clicking opens the wrong program instead of nothing at all, the file association is set to the wrong app rather than the file being broken.
The other possibility is that the file is not really a .md at all. Drop it into the file identifier to check it by its bytes instead of its name. Nothing is uploaded.
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 has no fixed magic number, so there is no signature table on this page. Its bytes alone do not prove the format: identification relies on the extension, the structure of the content and the program that created it. The magic-numbers reference lists the formats that do carry one.
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. How sources are ranked and what is deliberately left out is set out in the methodology.