Skip to content

Markdown Preview

Live GFM preview with sanitized, XSS-safe rendering.

Preview stats
8 lines · ~1 min read

Markdown Preview renders GitHub-flavored Markdown in your browser with XSS-safe sanitization. Write on the left, see formatted output on the right, and copy or download your source—heavy renderer dependencies load only when you open the preview pane.

How it works

Your Markdown passes through react-markdown with remark-gfm for tables, task lists, and other GFM extensions. rehype-sanitize strips dangerous HTML before anything reaches the DOM, so scripts and inline event handlers never execute.

Benefits

  • XSS-safe rendering with rehype-sanitize
  • GFM support for tables and task lists
  • Dynamic imports keep the initial bundle lean
  • Side-by-side editor and live preview
  • Copy and download actions built in

Use cases

  • Draft README sections before committing to a repo
  • Preview release notes or blog posts locally
  • Check how tables and code blocks will render on GitHub
  • Verify that untrusted Markdown is stripped safely

Best practices

  • Preview edge cases like nested lists and code fences
  • Avoid relying on raw HTML—prefer standard Markdown syntax
  • Use fenced code blocks with language tags for clarity
  • Clear the workspace before pasting confidential drafts on shared PCs

Common mistakes

  • Expecting unsanitized HTML to render verbatim
  • Forgetting blank lines before headings or lists
  • Using tabs inside tables where pipe alignment matters
  • Assuming single newlines create paragraph breaks

Privacy

All Markdown parsing and rendering happen locally in your browser. ToolHub does not upload your documents. Optional device history stores editor text only if you explicitly enable and save entries on this machine.

Frequently asked questions

Is the Markdown preview safe from XSS?
Yes. The preview uses react-markdown with rehype-sanitize so raw HTML and dangerous attributes are stripped before rendering. The tool never uses unsanitized dangerouslySetInnerHTML.
Does Markdown Preview upload my document?
No. Parsing and rendering happen entirely in your browser. Your Markdown never leaves your device for this tool.
Which Markdown flavor is supported?
GitHub-flavored Markdown via remark-gfm—tables, task lists, strikethrough, and autolinks are supported alongside standard CommonMark constructs.
Why does the preview load after a short delay?
Heavy renderer dependencies (react-markdown, remark-gfm, rehype-sanitize) are dynamically imported so the initial tool page stays lightweight.
Can I download my Markdown?
Yes. Use Download to save the current editor contents as a .md file on your device.
Will embedded HTML render as-is?
Unsafe HTML is sanitized. Script tags, event handlers, and similar vectors are removed rather than executed in your browser.
Is my Markdown stored in LocalStorage?
Not by default. Optional on-device history can remember recent inputs if you enable it. Clear history on shared machines before leaving.

Version 1.0.0 · Updated 2026-07-27 · 1 minute