Search DevTools

Jump to any tool or page

Markdown Previewer

Write GitHub-flavored Markdown on the left and see the sanitized, rendered HTML on the right.

Markdown
Preview
Visual Creation

About Markdown Preview

Write Markdown and see the rendered HTML side by side, with GitHub-flavoured extensions such as tables, task lists and fenced code blocks. Markdown has no single specification: CommonMark fixed the ambiguities in John Gruber's original, and GFM layers extensions on top, which is why the same document can render differently in your editor, in a static site generator and on GitHub.

Frequently asked questions

Why does my single line break disappear?
In CommonMark a single newline inside a paragraph is a soft break and renders as an ordinary space, not a br tag. To force a hard break you either end the line with two or more spaces or use a trailing backslash. A blank line starts a new paragraph. GitHub comment boxes and many chat apps enable a breaks option that turns every newline into a br, which is why text copied out of an issue reflows unexpectedly in a proper Markdown file.
Is raw HTML allowed inside Markdown, and is it sanitised?
CommonMark permits raw HTML blocks and inline tags to pass through untouched, which is why a Markdown renderer is an XSS vector unless output is sanitised. GitHub strips script, style, iframe and event handler attributes on render. A blank line matters here too: Markdown inside an HTML block is not processed by default, so putting **bold** directly inside a div often emits literal asterisks unless the parser supports the markdown attribute.
How do nested lists and indentation actually work?
Indentation for a nested list is measured from the content column of the parent item, not from a fixed four spaces. After the marker "- " the content starts at column 2, so two spaces nests correctly; after "1. " it starts at column 3. Mixing tabs and spaces is the usual culprit for a sub-list rendering as a code block, since four spaces of indent in a non-list context means an indented code block. Fenced code blocks avoid that ambiguity entirely.
What is front matter and why does it show up as text?
A YAML block delimited by --- at the very top of a file is a convention used by Jekyll, Hugo, Astro and most static generators to carry metadata. It is not part of CommonMark or GFM, so a plain renderer has no reason to hide it — and because --- is also the setext syntax for an h2 underline, the first key often renders as a heading followed by a horizontal rule. Strip front matter before rendering, or use a parser configured to recognise it.
Why do my tables break when a cell contains a pipe?
GFM tables are delimited by unescaped pipes, so a literal pipe inside a cell must be written as \| — including inside inline code spans, where the usual backtick escaping does not protect it. Tables also require the header separator row, must not be indented four or more spaces, and cannot contain block-level content such as lists or multiple paragraphs in a cell. If a table needs that structure, an HTML table is the honest answer.