How to use the Markdown editor
- Type or paste Markdown into Markdown. The Preview updates as you type. A sample document is loaded so you can see the result at once, and you can select it all and replace it.
- Click Open file to load a .md or .txt file, for example a README.
- Tick Line breaks like GitHub comments if a single line break should start a new line. Leave it off to match how GitHub renders README files.
- Use Stacked view on wide screens to put the preview under the editor, or Full-screen preview to read the result without distractions. Press Escape to leave full screen.
- Copy HTML copies the cleaned HTML of the preview. Copy Markdown and Download .md keep your source text.
How it works
The text is converted to HTML by the open source marked library, which follows CommonMark and the GitHub Flavored Markdown specification, so tables, task lists, strikethrough and fenced code blocks work. The HTML is then cleaned with DOMPurify, which removes scripts, event handlers and unsafe links, and it is shown inside a sandboxed frame that cannot run code. Code blocks with a language name are colored by highlight.js. Headings get GitHub-style ids, so a link such as [Top](#release-notes) jumps to the heading.
Worked example
The default document shows most of the syntax at once. The preview renders "Release notes" as a top heading, a sentence with 2.4 in bold and a link, a "What's new" subheading with a task list (two items checked, one open), a two-column table of plans and prices, a tip as a blockquote, and a JavaScript code block with colored keywords. The counters under the toolbar read "45 words" and "373 characters". Copy HTML starts with <h1 id="release-notes">Release notes</h1>.
Limits and edge cases
- You can mix HTML into Markdown, but scripts, event handlers, forms,
styleattributes and iframes are removed. The preview shows what is left. - Images from other websites may not load because this site's security policy only allows images from this site and embedded data: images. A blocked image shows its alt text.
- Single line breaks are ignored by default, as in GitHub README files, so use a blank line for a new paragraph or two spaces at the end of a line for a line break.
- Other Markdown flavors add extras that are not rendered here, such as footnotes, math, diagrams and alert boxes.
- Word count ignores symbols such as # and -, and very large documents (over about 1 MB) may type slowly.
Frequently asked questions
Is Markdown the same as HTML?
No. Markdown is a plain-text shorthand that gets converted into HTML. It is quicker to read and write, which is why it is used for README files, documentation and notes.
Can I use HTML inside Markdown?
Yes, most Markdown parsers allow inline HTML. Here the HTML is cleaned first, so tags such as script and iframe and attributes such as onclick are removed from the preview and from the copied HTML.
What is GitHub Flavored Markdown?
GitHub Flavored Markdown, or GFM, is CommonMark plus tables, task lists, strikethrough and automatic links. It is also used by GitLab, Bitbucket and many documentation tools.
Is my Markdown saved or uploaded?
No. Your text is rendered in your browser and is not uploaded or stored. When you close the tab it is gone, so copy it or use Download .md first.
Need clean HTML for a web page? Use the Markdown to HTML converter, or turn the document into a PDF with the Markdown to PDF converter. To check how long a draft is, paste it into the word counter, and to see what changed between two drafts, use the diff checker.