Markdown Preview
Write Markdown and see a live rendered preview side by side
What is Markdown?
Markdown is a lightweight markup language created by John Gruber in 2004, designed to be readable as plain text while convertible to structurally valid HTML. Its syntax uses punctuation characters to indicate formatting — asterisks for emphasis, hashes for headings, dashes for lists, backticks for code — so that even the raw source reads naturally. Markdown has become the default authoring format for README files, technical documentation, blog posts, issue trackers, and developer communication platforms.
GitHub Flavored Markdown (GFM) extends the original Markdown specification with features developers need daily: fenced code blocks with language-specific syntax highlighting, tables with alignment control, task lists with checkboxes, strikethrough text, and autolinked URLs. GFM is the standard on GitHub, GitLab, Bitbucket, and most developer tools, making it the de facto dialect for developer documentation.
A live Markdown preview eliminates the write-commit-check cycle by rendering your Markdown in real time as you type. Instead of pushing a README to GitHub to see if the tables render correctly or if the nested lists indent properly, you see the rendered output side by side with your source. This immediate feedback loop catches formatting issues before they reach your repository.
How it works
Markdown rendering is a two-stage pipeline: parsing and HTML generation. The parser (typically using a library like marked or markdown-it) reads the Markdown source and builds an abstract syntax tree (AST) representing the document structure — headings, paragraphs, lists, code blocks, inline formatting, links, images, and tables. The parser handles GFM extensions by recognizing syntax patterns like ~~strikethrough~~, [x] task lists, and pipe-delimited tables that are not part of the original Markdown specification.
The AST is then walked by a renderer that emits HTML for each node type. A heading node becomes an <h1> through <h6> tag, a paragraph becomes <p>, a fenced code block becomes <pre><code> with a language class for syntax highlighting, and a table becomes the full <table>/<thead>/<tbody> structure. Inline elements like bold, italic, links, and inline code are rendered within their parent block elements. The renderer handles nested structures — lists within lists, emphasis within links — by recursively processing child nodes.
Before the HTML reaches the browser DOM, it passes through DOMPurify — a sanitization library that strips potentially dangerous elements and attributes. This is critical because Markdown allows inline HTML, and unsanitized user input could contain <script> tags, onload event handlers, or other XSS vectors. DOMPurify maintains an allowlist of safe tags and attributes, removing everything else while preserving the document's intended visual structure.
How to use this tool
- Type or paste your Markdown content into the editor panel on the left. The rendered preview appears automatically in the right panel and updates as you type.
- Use standard Markdown syntax for formatting: # for headings (## for h2, ### for h3), **bold**, *italic*, [links](url), , and backticks for `inline code`.
- Create fenced code blocks with triple backticks and a language name for syntax highlighting (e.g., ```javascript). End the block with another triple backtick line.
- Build tables using pipes (|) and dashes (-). The first row is the header, the second row is the separator (use colons for alignment), and subsequent rows are data. Ensure consistent pipe counts across all rows.
- Add task lists using - [ ] for unchecked and - [x] for checked items. These render as interactive checkboxes in the preview, matching GitHub's rendering.
- Review the preview for formatting issues before copying the Markdown source into your project. Pay attention to spacing around headings, blank lines between block elements, and list indentation.
Examples
Writing a project README with badges and tables
Start with a level-1 heading, add shield.io badge images as linked images, include a feature comparison table with alignment, and structure installation and usage sections with code blocks. The live preview shows exactly how this will appear on GitHub's repository page.
Formatting a pull request description
Use a level-2 heading for "Changes," a bulleted list summarizing modifications, a task list for review checklist items, and fenced code blocks showing before/after code snippets. The preview confirms the description is readable and well-structured before you submit the PR.
Creating technical documentation with nested lists and code
Document an API endpoint with a heading, a description paragraph, a nested list of parameters (with type annotations in inline code), and a fenced JSON code block showing an example request body. The preview verifies that nesting is correct and the code block renders with highlighting.
Drafting a changelog with links and emphasis
Structure a changelog with version headings (## v2.1.0), categorized lists (### Added, ### Fixed), linked issue references ([#123](url)), and bold text for breaking changes. The preview ensures the hierarchical structure and links render correctly.
About this tool
Edit Markdown in a live editor with a side-by-side rendered preview. Supports full GitHub Flavored Markdown syntax including tables, code blocks, and task lists. Output is sanitized with DOMPurify for safety.
Common use cases
- • Previewing README files and documentation before pushing to GitHub
- • Writing and formatting pull request descriptions or issue reports
- • Drafting blog posts or technical documentation with live rendering
- • Testing Markdown table formatting and nested list structures
Frequently asked questions
- Which Markdown flavor does this tool support?
- The editor supports GitHub Flavored Markdown (GFM) including tables, task lists, strikethrough, fenced code blocks with syntax highlighting, and autolinks. This is the same Markdown syntax used on GitHub, GitLab, and most developer platforms.
- Is the HTML output safe to use?
- Yes. All rendered HTML is sanitized with DOMPurify to remove potentially dangerous content like script tags, event handlers, and other XSS vectors. The output is safe for embedding in web pages.
- Can I export the rendered HTML?
- The preview shows the rendered output as it would appear on GitHub. You can copy the Markdown source for use in your project, or inspect the rendered HTML in your browser's developer tools if you need the raw HTML output.
- Does this tool support syntax highlighting in code blocks?
- Yes. Fenced code blocks with a language identifier (e.g., ```javascript or ```python) are rendered with syntax highlighting. The tool supports all commonly used languages including JavaScript, TypeScript, Python, Go, Rust, Java, C/C++, SQL, HTML, CSS, Bash, and YAML. If no language is specified, the block is rendered as plain monospace text.
- Can I use HTML inside my Markdown?
- GitHub Flavored Markdown allows inline HTML for elements that Markdown syntax cannot express — like <details> collapsible sections, <kbd> keyboard keys, or <sup> superscripts. This tool renders safe HTML elements but sanitizes potentially dangerous tags (like <script> and event handlers) through DOMPurify to prevent cross-site scripting.
- Why does my table not render correctly?
- GFM tables require a header row, a separator row with dashes and pipes (|---|---|), and data rows. Common mistakes include missing the separator row, inconsistent pipe counts across rows, or missing leading/trailing pipes. The separator row must have at least three dashes per column. Colons in the separator row control alignment: :--- for left, :---: for center, ---: for right.