Markdown Preview

This markdown preview tool lets you write and render Markdown side by side. Supports headers, lists, code blocks, links, bold, italic, and more.

Write Markdown on the left and see it rendered as HTML on the right in real time. This split-pane editor supports headings, bold, italic, links, lists, code blocks, blockquotes, tables, and more. Copy the generated HTML with one click. Everything runs in your browser - nothing is sent to a server, making it safe for private notes, draft documentation, or pre-publication content.

Ad
Ad

About Markdown Preview

Markdown Syntax Reference

Markdown uses plain text formatting that converts to HTML. John Gruber introduced the original syntax in March 2004 on Daring Fireball with the goal that a Markdown document should be readable as plain text, without looking marked up. Aaron Swartz collaborated on the early design. The original Perl reference script (Markdown 1.0.1) was released in December 2004 and is still available at daringfireball.net.

ElementMarkdown SyntaxHTML Output
Heading 1# Heading<h1>Heading</h1>
Heading 2## Heading<h2>Heading</h2>
Heading 3### Heading<h3>Heading</h3>
Bold**bold text**<strong>bold text</strong>
Italic*italic text*<em>italic text</em>
Bold + Italic***both***<strong><em>both</em></strong>
Inline code`code here`<code>code here</code>
Link[text](url)<a href="url">text</a>
Image![alt](url)<img src="url" alt="alt">
Blockquote> quoted text<blockquote>quoted text</blockquote>
Horizontal rule---<hr>
Unordered list- item<ul><li>item</li></ul>
Ordered list1. item<ol><li>item</li></ol>

Code Blocks

Fenced code blocks use triple backticks (```) on the lines before and after the code. You can optionally specify a language after the opening backticks for syntax highlighting hints, though this tool renders code blocks as plain <pre><code> without language-specific highlighting. Indented code blocks (four spaces at the start of a line) are part of the original Gruber spec but are generally discouraged in modern writing because fenced blocks are clearer and support language hints.

MarkdownHTML
```\ncode here\n```<pre><code>code here</code></pre>
```js\nconsole.log("hi")\n```<pre><code class="language-js">...</code></pre>

Where Markdown Is Used

Markdown is the default writing format across most developer tooling, documentation platforms, and note-taking apps. Each platform has its own flavour with slightly different syntax extensions:

Platform/ToolMarkdown VariantNotable Extensions
GitHubGitHub Flavored Markdown (GFM)Tables, task lists, autolinks, strikethrough
GitLabGFM + extensionsMermaid diagrams, math blocks, footnotes
Stack OverflowCommonMark variantSnippets, spoiler blocks
RedditCustom variantSpoiler tags, superscript
NotionMarkdown-like/ commands, databases, toggles
ObsidianCommonMark + extensionsWiki links, callouts, dataview
Jekyll / HugoCommonMark or GoldmarkFront matter, shortcodes
Jupyter NotebooksCommonMarkLaTeX math, HTML embedding
Discord / SlackSubsetBold, italic, code, strikethrough, block quotes

Markdown Specifications

The original Markdown spec left many edge cases unspecified, which led to incompatible implementations. CommonMark was started in 2014 to address this with a rigorous, testable specification. The latest version is CommonMark 0.31.2, released on 28 January 2024 at spec.commonmark.org. GitHub Flavored Markdown builds on CommonMark with tables, task lists, strikethrough, and autolinks.

SpecStatusKey Differences from Original
Original Markdown (Gruber)2004, no formal specAmbiguous edge cases, no tables
CommonMarkActive standard, version 0.31.2 (January 2024)Strict rules for edge cases, well-defined behaviour, ~650 test cases
GitHub Flavored MarkdownCommonMark superset (current)Adds tables, task lists, strikethrough, autolinks, disallowed raw HTML
MultiMarkdownExtended specFootnotes, citations, math, metadata
Pandoc MarkdownExtended specDefinition lists, superscript, subscript, inline HTML

This tool implements a lightweight parser covering core Markdown syntax. It is not a full CommonMark or GFM implementation, so complex nesting edge cases may differ. For most writing tasks - READMEs, documentation, blog posts, notes - the supported syntax is more than sufficient. If you need strict CommonMark compliance, use a library like markdown-it, marked, or remark in your own build.

Markdown Best Practices

Consistency matters more than perfect adherence to any single flavour. These conventions tend to produce the cleanest source files and the most portable output:

PracticeWhy
Use ATX headings (# style) not Setext (underline)Consistent, supports h1-h6, easier to scan
Leave a blank line before and after headingsSome parsers require it, and it improves source readability
Use fenced code blocks, not indented blocksClearer boundaries, supports language hints
Use - for unordered lists (not * or +)Most common convention, consistent rendering
Use reference links for long URLs[text][ref] keeps paragraphs readable
One sentence per line in sourceBetter git diffs when editing prose
Escape pipes inside table cells with \|Prevents breaking the column layout
Keep table cells shortLong cells force horizontal scroll on mobile

Common Markdown Pitfalls

Most rendering bugs come from a handful of predictable mistakes. The table below covers the ones that catch writers out most often.

ProblemCauseFix
Heading not renderingMissing space after the # characterWrite "# Heading" not "#Heading"
List items running togetherNo blank line before the listAdd a blank line before and after the list block
Bold inside a word not workingUnderscore emphasis in mid-word is intra-word in most parsersUse asterisks: some**bold**word renders correctly
Underscores in variable names showing as italicsnake_case_names trigger emphasisWrap in backticks: `my_variable_name`
Angle brackets vanishingParser treats them as autolinks or HTMLEscape with backslash: \< or wrap in backticks
Nested lists not indentingInconsistent indentation (tabs vs spaces)Use 2 or 4 spaces consistently
Inline code with backticks insideSingle backtick can't wrap a backtickUse double backticks: ``code with ` inside``

How Popular Is Markdown?

Markdown has become the near-universal format for developer and writer-facing text. GitHub alone hosts hundreds of millions of README.md files, and Stack Overflow, Reddit, and most issue trackers use a Markdown variant. Every major static site generator (Jekyll, Hugo, Eleventy, Astro, Gatsby, Docusaurus) treats Markdown as the primary content format. Note-taking apps that ship with Markdown as the canonical storage format include Obsidian, Logseq, Bear, Ulysses, and iA Writer. Most AI chat interfaces (ChatGPT, Claude, Gemini) also render Markdown-formatted responses by default, which means writing prompts and notes in Markdown pays dividends across the entire developer toolchain.

CategoryExamplesWhy Markdown
Code hostingGitHub, GitLab, Bitbucket, CodebergIssues, PRs, READMEs, wikis all use MD
Static site generatorsJekyll, Hugo, Eleventy, Astro, Next.js, DocusaurusContent as plain files in git
Note appsObsidian, Logseq, Bear, Ulysses, iA WriterPlain text files outlive proprietary formats
Chat platformsSlack, Discord, Teams, MatrixLightweight formatting without WYSIWYG
AI interfacesChatGPT, Claude, Gemini, CopilotStructured output that renders in the client
DocumentationRead the Docs, MkDocs, GitBook, DocusaurusVersioned, diff-friendly, easy to contribute to

Popular Markdown Parsers

When you need strict specification compliance or advanced features, choose a mature parser rather than rolling your own. The landscape has consolidated around a few well-maintained implementations, each with different trade-offs between speed, compliance, and extensibility.

ParserLanguageBest For
markdown-itJavaScriptCommonMark compliance with plugin ecosystem
markedJavaScriptSpeed, minimal dependencies
remark (unified)JavaScriptAST-based transforms, static site pipelines
GoldmarkGoDefault parser for Hugo, CommonMark-compliant
commonmark.py / markdown-it-pyPythonJupyter, MkDocs, Python tooling
league/commonmarkPHPLaravel, WordPress plugins, PHP CMS
PandocHaskellCross-format conversion (MD to PDF, DOCX, LaTeX)

Markdown to HTML Conversion

The "Copy HTML" button copies the rendered HTML for pasting into content management systems, email templates, or static sites. This makes the tool useful not just for previewing but also for converting Markdown to production HTML.

Use CaseWorkflow
CMS content entryWrite in Markdown, copy HTML, paste into rich text editor
Email templatesDraft content in Markdown, copy HTML for the email body
Static site contentPreview rendering before committing to repo
DocumentationCheck formatting of README.md before pushing
AI prompt draftingPreview how ChatGPT or Claude will render your formatted prompt
Issue templatesPre-check bug reports before pasting into GitHub/Jira

Is Markdown Accessible?

Markdown that converts to semantic HTML (headings, lists, tables, blockquotes) is inherently more accessible than a wall of text or a visual WYSIWYG document. Screen readers rely on the heading outline to navigate, so using proper heading levels (# for the page title, ## for sections, ### for sub-sections) without skipping levels is essential. The W3C WCAG 2.2 guidelines specifically recommend a logical heading hierarchy. Tables should have header rows (the pipe-dash-pipe separator line in GFM), and images must include alt text inside the square brackets of the image syntax.

Accessibility PracticeMarkdown Pattern
Use a single H1 per pageOnly one # line at the top of the document
Don't skip heading levelsGo #, then ##, then ### - never # then ###
Always add alt text to images![Descriptive alt text](image.jpg) - never ![](image.jpg)
Write link text that makes sense alone[2024 financial report] not [click here]
Keep tables simpleAvoid merged cells and complex layouts - flat tables read better

Security Considerations When Rendering Markdown

Untrusted Markdown is not safe HTML. Any parser that allows raw HTML pass-through can be a vector for XSS if you render user-submitted Markdown. GitHub Flavored Markdown explicitly disallows a set of raw HTML tags (script, style, iframe, embed, object, and others) for this reason. When building a system that renders third-party Markdown, either disable raw HTML entirely or run the output through a sanitiser like DOMPurify. URL schemes in links should be restricted to http, https, and mailto to prevent javascript: URIs. This tool validates link protocols and escapes HTML entities before parsing, so pasted content cannot inject scripts into the preview.

If the HTML output needs cleanup, run it through the HTML Prettifier. For checking word and character counts in your Markdown content, the Word Counter gives character, word, and sentence counts. If you need to escape special characters like < and > before embedding in HTML, the HTML Entity Encoder / Decoder handles that. All processing runs in your browser - your content stays private.

Sources

Frequently Asked Questions

What Markdown syntax does this tool support?

This tool supports the most commonly used Markdown features including headings (h1 through h6), bold, italic, inline code, code blocks with triple backticks, ordered and unordered lists, links, blockquotes, horizontal rules, and paragraphs. It covers the core Markdown specification that handles the vast majority of everyday formatting needs.

Can I copy the generated HTML?

Yes. Click the "Copy HTML" button to copy the raw HTML output to your clipboard. This is useful when you need to paste formatted content into a CMS, email template, or static site that accepts HTML directly.

Is this a full CommonMark or GFM implementation?

This tool implements a lightweight Markdown parser that covers the most widely used syntax elements. It is not a full CommonMark or GitHub Flavored Markdown implementation, so edge cases like nested blockquotes or complex list nesting may not render exactly as they would on GitHub. For most writing and documentation tasks, the supported syntax is more than sufficient.

Does the preview update automatically as I type?

Yes. The HTML preview updates in real time as you type in the editor pane. There is no need to click a button to refresh the preview, making it easy to see exactly how your Markdown will render while you write.

Link to this tool

Copy this HTML to link to this tool from your website or blog.

<a href="https://toolboxkit.io/tools/markdown-preview/" title="Markdown Preview - Free Online Tool">Try Markdown Preview on ToolboxKit.io</a>