Nifty Dev Tools
  1. Home
  2. Markdown Preview
Text

Type, paste or open a Markdown file like a README and watch it render as you write, right in your browser.

Markdown

In a list, Tab indents the item and Shift+Tab moves it back out. To leave the editor from a list, press Escape, then Tab.

Preview

Your rendered Markdown will show up here.

How to use the Markdown Preview

  1. Type or paste Markdown into the Markdown box, press Open file, or drag a .md file (a README, notes, docs) onto it. Press Example to see a short README.
  2. Format with the formatting bar above the text or its shortcuts (see below): select some text and press Bold, or put the cursor on a line and press Bulleted list.
  3. The preview next to it updates as you type, the way GitHub shows a README: headings, lists, tables, task lists, alerts, code blocks and links. The pane's header counts the words.
  4. Press Copy HTML to paste the result into a web page, a CMS or an email, Download .html for a page that opens in any browser, or Download .md to save your Markdown as a file.

Links in the preview open in a new tab. A link to a heading in the same document, like [Commands](#commands), scrolls the preview to that heading.

Formatting bar and shortcuts

Each button works on the selected text or the line the cursor is on, and pressing it again takes the formatting off. Line buttons (heading, quote, lists) change every selected line. Undo (Ctrl+Z, ⌘Z on a Mac) takes back one button press at a time.

ButtonWhat it writesShortcut (⌘ instead of Ctrl on a Mac)
Heading# , then ## , ### and none on each press
Bold**text**Ctrl+B
Italic*text*Ctrl+I
Strikethrough~~text~~
Code`text`, or a code block around several linesCtrl+E
Link[text](url) with url selectedCtrl+K
Quote> before each lineCtrl+Shift+.
Bulleted list- before each lineCtrl+Shift+8
Numbered list1. , 2. , 3. …Ctrl+Shift+7
Task list- [ ] before each line
Tablea table with 3 columns to fill in
Divider--- on its own line

Typing helps too:

  • Lists continue: press Enter at the end of a list item and the next line starts with the same -, the next number, a new - [ ] task or > for a quote. Press Enter on an empty item to end the list.
  • Tab indents a list item under the one above, Shift+Tab moves it back out. Outside lists, Tab moves to the next part of the page as usual. To leave the editor from inside a list, press Escape, then Tab.
  • Select text and type *, _, ~, `, a quote or a bracket to put it around the selection. Typing (, [ or { adds the closing one.

Markdown cheat sheet

What you write on the left, and the HTML the preview makes from it. Every result below comes from the same renderer the tool uses.

Text

You writeYou get
**bold**<strong>bold</strong>
*italic*<em>italic</em>
~~strikethrough~~<del>strikethrough</del>
`code`<code>code</code>
[link](https://example.com)<a href="https://example.com">link</a>
https://example.com<a href="https://example.com">https://example.com</a>
![a cat](cat.png)<img src="cat.png" alt="a cat">
\*not italic\**not italic*
<kbd>Ctrl</kbd> + <kbd>C</kbd><kbd>Ctrl</kbd> + <kbd>C</kbd>
H<sub>2</sub>O and x<sup>2</sup>H<sub>2</sub>O and x<sup>2</sup>

Text separated by blank lines becomes paragraphs, so each result above sits inside <p>…</p>.

Headings

One # for the title, more for smaller headings (up to six). Each gets an id for links like #section:

# Title

## Section

### Subsection
<h1 id="title">Title</h1>
<h2 id="section">Section</h2>
<h3 id="subsection">Subsection</h3>

Lists

Start lines with - (or *) for bullets and 1. for numbers. Indent by two spaces to nest:

- Apples
- Pears
  - Green ones

1. First
2. Second
<ul>
<li>Apples</li>
<li>Pears
<ul>
<li>Green ones</li>
</ul>
</li>
</ul>
<ol>
<li>First</li>
<li>Second</li>
</ol>

Task lists

- [x] Write the docs
- [ ] Ship it
<ul class="contains-task-list">
<li class="task-list-item"><input class="task-list-item-checkbox" type="checkbox" checked="" disabled=""> Write the docs</li>
<li class="task-list-item"><input class="task-list-item-checkbox" type="checkbox" disabled=""> Ship it</li>
</ul>

Code blocks

Three backticks before and after; the language after the first three is optional:

```js
const answer = 42;
```
<pre><code class="language-js">const answer = 42;
</code></pre>

Quotes

> Markdown is a text-to-HTML conversion tool.
> — John Gruber
<blockquote>
<p>Markdown is a text-to-HTML conversion tool.
— John Gruber</p>
</blockquote>

Alerts

A quote that starts with [!NOTE], [!TIP], [!IMPORTANT], [!WARNING] or [!CAUTION] on its own line becomes a callout with that title, like on GitHub:

> [!NOTE]
> Notes are plain files, so any editor can open them.

> [!WARNING]
> Deleting a folder deletes its notes too.
<div class="markdown-alert markdown-alert-note">
<p class="markdown-alert-title">Note</p>
<p>Notes are plain files, so any editor can open them.</p>
</div>
<div class="markdown-alert markdown-alert-warning">
<p class="markdown-alert-title">Warning</p>
<p>Deleting a folder deletes its notes too.</p>
</div>

Tables

Columns are separated by |. The line under the header aligns them: :--- left, :---: center, ---: right.

| Command | Short |
| :------ | :---: |
| `add`   |  `a`  |
| `list`  | `ls`  |
<table>
<thead>
<tr>
<th align="left">Command</th>
<th align="center">Short</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left"><code>add</code></td>
<td align="center"><code>a</code></td>
</tr>
<tr>
<td align="left"><code>list</code></td>
<td align="center"><code>ls</code></td>
</tr>
</tbody>
</table>

Lines and line breaks

Three dashes on their own line draw a line. A \ at the end of a line breaks it without starting a new paragraph:

Above the line

---

First line\
Second line
<p>Above the line</p>
<hr>
<p>First line<br>
Second line</p>

Collapsible sections

HTML works inside Markdown too. Leave a blank line around the Markdown inside it:

<details>
<summary>Show more</summary>

Hidden **text**.

</details>
<details>
<summary>Show more</summary>
<p>Hidden <strong>text</strong>.</p>
</details>

GitHub-style extras

Markdown has a standard, CommonMark, and GitHub adds a few things to it (GitHub Flavored Markdown, GFM). The preview follows both:

  • Tables, aligned left, center or right with : in the line under the header.
  • Task lists: - [ ] and - [x] become checkboxes. They show the state; you can't tick them here.
  • Strikethrough with two tildes: ~~old~~.
  • Autolinks: addresses starting with https://, http:// or www., and e-mail addresses become links on their own. File names like README.md stay text.
  • Code blocks with a language: the language is kept as a class (language-js) for your own highlighter. The preview shows code without colors.
  • Heading anchors: every heading gets the same id as on GitHub (## Install → #install), so in-page links work.
  • Alerts: > [!NOTE], > [!TIP], > [!IMPORTANT], > [!WARNING] and > [!CAUTION] become callouts with a title and an icon, in the preview and in the copied or downloaded HTML (GitHub's class names).
  • HTML in Markdown: tags that format text, like <details>, <kbd>, <sub>, <sup>, <br> and <p align="center">.

Not supported yet: footnotes, emoji codes like :tada:, math, Mermaid diagrams and strikethrough with a single tilde.

FAQ

Is my text uploaded anywhere?

No. The Markdown Preview runs in your browser, including opening files: a file you open or drop is read right here, and we never upload, log or store your text. It doesn't remember your input either: reload the page and it's gone. See the privacy page for details.

Why don't images from other websites show?

Showing an image means asking the website that hosts it for the file. The preview never does that: each image from another website shows as a box with its description and the site's name instead. Images written into the text itself (addresses starting with data:image/) show normally. Images with a file path, like docs/screen.png, have no file next to the preview, so they show as a box too. Copy HTML and Download .html keep every image as a normal <img> tag, so they show when you use the HTML.

Does it run HTML or scripts in my Markdown?

HTML that formats text works: <details>, <kbd>, <sub>, <br>, <p align="center"> and the like. Nothing that could run code or change the page gets through: <script>, <style>, <iframe> and SVG show as plain text (the way GitHub shows them), other tags like <form> or <center> are dropped and keep their text, and event attributes like onclick, style attributes and javascript: links are removed. The copied and downloaded HTML is cleaned the same way.

Why isn't my Markdown after an HTML tag converted?

A line that starts with an HTML tag like <p>, <div> or <h1> starts an HTML block, and Markdown keeps that block going until the next empty line. Everything up to there counts as HTML, so Markdown on the lines right after the tag stays plain text. GitHub works the same way. Here is some Markdown and the HTML it makes: the second line comes out exactly as typed, stars and all.

<p align="center">Tiny Notes</p>
**Fast** and small.
<p align="center">Tiny Notes</p>
**Fast** and small.

The preview points it out: “Line 2 shows as plain text: Markdown right after an HTML tag needs an empty line before it. Add one after line 1.” With the empty line, the second line is Markdown again (the Markdown, then its HTML):

<p align="center">Tiny Notes</p>

**Fast** and small.
<p align="center">Tiny Notes</p>
<p><strong>Fast</strong> and small.</p>

The same goes for Markdown inside a tag like <details>: leave an empty line before and after it.

Can I export the HTML?

Yes. Copy HTML copies just the content, ready to paste into a page, a CMS or a blog editor. Download .html saves a complete page with simple styles for light and dark mode that opens in any browser; its title is your first heading. Headings keep GitHub-style ids, and links and image addresses stay as you wrote them.

How do I open a .md file?

Press Open file and pick it, or drag it onto the Markdown box: it's shown rendered right away. A .md file is plain text written in Markdown, so any text file works (.md, .markdown, .txt), up to 20 MB. You can edit it here and save it again with Download .md.

Why does my README look a little different on GitHub?

The preview follows the same rules, so the structure matches: the same headings, lists, tables and links. The look is this site's, and a few GitHub-only features (footnotes, emoji codes, math, diagrams) aren't supported yet. Relative links like docs/setup.md only work next to their files, so the preview shows them as plain text.