
How to use the Markdown editor
Write on the left. The right side shows the page as a reader will see it, and it updates while you type. The toolbar adds the marks for you: select a word and click B, or press Ctrl+B, and the word gets two asterisks on each side.
- Write or openType Markdown, paste it, or drop a .md or .txt file on the page.
- Check the previewHeadings, lists, links and tables show up on the right as you type.
- Save or copySave the .md file, download a web page, or copy the HTML into your site.
What is Markdown?
Markdown is a way to write formatted text with plain characters. A # at the start of a line makes a heading, and two asterisks around a word make it bold. The file stays plain text, so any editor can open it, and people can read it even without a preview.
John Gruber made Markdown in 2004. His rules left many details open, so each tool filled them in a little differently. In 2014 CommonMark wrote down exact rules, and GitHub built its own version on top of them. This editor follows CommonMark and adds the GitHub extras, called GitHub Flavored Markdown (GFM).
The ten rules that cover most of Markdown
These rules are enough for most notes and README files. Footnotes, escaping and the other extras are in the Cheat sheet above the editor.
| Rule | You type | You get | ||||||
|---|---|---|---|---|---|---|---|---|
| Headings | # Title ## Section ### Smaller heading | Title Section Smaller heading | ||||||
| Paragraphs and line breaks | One paragraph. A blank line starts a new one. Two spaces at the end make a line break. | One paragraph. A blank line starts a new one. | ||||||
| Bold and italic | **bold**, *italic* and ***both*** | bold, italic and both | ||||||
| Lists | - Apples - Pears - Nested with two spaces 1. First 2. Second |
| ||||||
| Links | [TextEditor.com](https://texteditor.com/ "Free text tools") or just <https://texteditor.com/> | |||||||
| Images |  |
| ||||||
| Code | Inline `code` in a sentence. ```js let total = price * 2; ``` | Inline | ||||||
| Quotes | > A quote. > It can run over several lines. |
| ||||||
| Horizontal rule | Above the line --- Below the line | Above the line Below the line | ||||||
| Tables | | Item | Price | |:------|------:| | Bread | 2.50 | | Milk | 1.20 | |
|
Common Markdown mistakes
Most Markdown problems come from spaces and blank lines. Click the button to see the fixed source next to the result.
| Mistake | You type | You get |
|---|---|---|
| No blank line before a listThis one works in most editors today, including this one. Older tools glue the list to the sentence. A blank line is always safe. | Shopping: - bread - milk | Shopping:
|
| Enter alone does not break a lineBoth lines join into one. End the first line with two spaces or a backslash to break it. | Roses are red Violets are blue | Roses are red Violets are blue |
| Four spaces or a tab turns text into codeFour spaces at the start of a line mean a code block. Tabs count as four spaces. Nested lists need only two spaces. | Dear team,
Thanks for the report. | Dear team, |
| No space after the hashWithout the space it is just a hashtag in a paragraph. | #Summary | #Summary |
| Underscores inside wordsAn underscore inside a word never starts italics, so file names are safe. Asterisks do work inside words. | snake_case_name is *not* italic | snake_case_name is not italic |
Markdown, HTML or rich text?
All three give you headings, bold text and lists. They differ in who reads the file and how much control you get.
| Markdown | HTML | Rich text | |
|---|---|---|---|
| What you see while writing | Plain text with a few marks | Tags like <p> and <a> | The finished look, like in Word |
| Good for | Notes, README files, docs, forum posts | Web pages, email templates, exact layout | Letters, email, pasting into Word |
| Control over the look | Low: the site that shows it picks the style | Full, with CSS | Medium: fonts and colors, no code |
| Opens in | Any text editor, GitHub, note apps | Any browser | Word, Google Docs, email |
| Tool on this site | This page | HTML editor and cleaner | Rich text editor |
Markdown can hold HTML for the things it can't do, like a picture with a set width. The preview here removes scripts from such tags, so pasted code can't run on this page.
Where .md files are used
A file that ends in .md is a Markdown file. GitHub shows the README.md of each project on its front page. Note apps like Obsidian and Joplin keep each note as a .md file, so the notes stay readable without the app. Site builders like Hugo and Jekyll turn a folder of .md files into a website. Reddit and Stack Overflow read the basic marks too, each with a few small differences.
Tables in Markdown
Tables were not part of the first Markdown. They come from GitHub's version, and most tools read them now. Pipes split the cells, and a row of hyphens under the first row makes it the header. A colon at the left or right end of the hyphens aligns that column. Lining up the pipes by hand is slow, so the Markdown table generator builds the text from a grid or a pasted spreadsheet.
Saving and exporting
Save .md writes a Markdown file. In Chrome and Edge the first save asks where to put it, and later saves go back into the same file. Other browsers download a new copy each time.
Copy formatted puts the preview on the clipboard as rich text, so headings and lists stay when you paste into Word, Google Docs or an email. For a PDF, pick PDF in the Download menu and choose "Save as PDF" as the printer. Only the preview is printed.
