Markdown preview
Write Markdown and see it rendered as you type, or copy the HTML. Raw HTML is shown as text and links are checked, so nothing in the preview can run.
Code examples
Copy and paste these into your own project. Each one uses only the language's standard library, so there is nothing to install.
const text = '# Hello\n\nSome **bold** text <b>raw</b>'
const escaped = text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')
const html = escaped
.split('\n\n')
.map((block) =>
block.startsWith('# ')
? `<h1>${block.slice(2)}</h1>`
: `<p>${block.replace(/\*\*(.+?)\*\*/g, '<strong>$1</strong>')}</p>`,
)
.join('\n')
console.log(html)What it does
Shows Markdown as a rendered page while you type, and gives you the HTML. It reads CommonMark and the GitHub extensions most documents use: tables, task lists, strikethrough and automatic links.
How to use it
- Type or paste Markdown, or drop a text file.
- Pick Preview to see the rendered page, or HTML to see the markup. Turn on line breaks if a single newline should start a new line, as in chat messages.
- Copy or download the HTML.
Examples
# Hello becomes <h1>Hello</h1>, and Some **bold** text becomes Some <strong>bold</strong> text. A table written with pipes and dashes becomes a real table, and - [x] done becomes a checked box.
Good to know
- Raw HTML in the source is shown as text, never passed on, so a script tag or an event handler in pasted Markdown cannot do anything.
- Only web, mail and phone links and relative addresses are kept as links. A
javascript:link stays plain text. - Images are never loaded in the preview. You see their description and address, and the copied HTML contains the image tag.
- The limit is 100,000 characters.
What does the preview support?
CommonMark plus the GitHub extensions used most: tables, task lists, strikethrough and automatic links. Everything is converted in your browser.
Frequently asked questions
Why is my raw HTML shown as text?
Raw HTML in Markdown can run scripts, so it is never passed through: script tags and other markup appear as typed. Use Markdown syntax instead. The HTML you copy is escaped the same way.
Why do images not load?
Images are never fetched, so a preview cannot be used to track you or to load anything from another site. You see the description and the address as plain text. The copied HTML does contain the image tag.
Does this tool send my text anywhere?
No. Everything happens in your browser. What you type is never sent to our servers.