Markdown Previewer
Preview sanitized Markdown HTML as you type.
Write and preview Markdown side by side with headings, lists, links, code, and tables. Generated HTML is sanitized before display.
Tool area
Worked example: HTML that gets sanitized on preview
Paste `# Title`, then a line with `<script>alert(1)</script>`, then a line with `- item one` on the left. The right-side preview shows an h1 heading and a bullet list, but the entire script tag disappears — it neither executes nor appears as visible text, because DOMPurify strips unsafe elements and attributes before rendering.
The preview re-renders on every keystroke because it listens for the input event, and there is no draft-saving feature. Refreshing or closing the tab discards everything typed, with no autosave or recovery.
- Verification method one: click Copy HTML, paste the sanitized output into a plain-text editor, and confirm there is no <script>, onclick, or other executable fragment left.
- Verification method two: download the HTML, open the standalone file in a browser, and compare its heading levels, lists, and code blocks against the original Markdown on the left.
Link behavior, and when a drawing tool fits better than a Markdown preview
Links inside the preview are not clickable: the script intercepts click events on any <a> tag in the preview and calls preventDefault(). To check whether a pasted link is correct, hover to see the status-bar URL or look at the raw Markdown on the left instead of clicking inside the preview.
If what you actually need is a freehand sketch, a signature, or a flow diagram rather than formatted text, this tool will not help. This site's Online Sketchpad supports freehand drawing with PNG export, and Flowchart Maker is built for directional step diagrams; neither one parses Markdown syntax.
How to use
- Enter Markdown on the left.
- Review the live preview on the right.
- Copy or download the sanitized HTML.
Use cases
- Preview README content.
- Draft technical docs and articles.
Content and verification review:
How to verify a Markdown Previewer result before relying on it
This section covers Markdown Previewer’s live rendering, what Copy HTML actually copies, and the standalone file that Download HTML produces.
Type Markdown on the left and watch the sanitized HTML on the right
The editor loads with a short sample (a heading followed by bold text), already rendered in the preview pane. Every keystroke in the textarea re-renders the preview immediately — there is no separate render button — and the HTML is passed through a sanitizer before display, so a pasted script tag or an onclick attribute is stripped out rather than executed.
Copy HTML copies the rendered markup, not your original Markdown source
Clicking Copy HTML puts the preview pane’s current sanitized HTML on the clipboard — for example, “**bold**” becomes “<strong>bold</strong>” in what gets copied, not the literal Markdown characters you typed. If what you actually need is the original Markdown text, to paste into another Markdown editor, select and copy directly from the left-hand textarea instead; Copy HTML will not give you that.
Download HTML produces a complete, styled standalone file — not a raw fragment
Clicking Download HTML does not save just the inner content — it wraps the current sanitized preview in a full HTML document with its own head section, a basic readable stylesheet for headings, code blocks, tables, and blockquotes, and a default filename of “markdown-preview.html,” so the download opens correctly as a self-contained page in any browser. Links inside the live preview pane itself are inert by design — clicking one in the preview does not navigate away from the tool.
Acceptance checklist
- Copy HTML is understood to copy the rendered sanitized HTML, not the original Markdown syntax you typed.
- A pasted script tag or inline event handler has been confirmed to not execute in the preview, since the HTML is sanitized before display.
- The downloaded HTML file has been opened once to confirm it renders as a complete standalone page, not a bare fragment.
- If the raw Markdown source itself is needed elsewhere, it is copied from the left-hand editor, not from Copy HTML.
Who is it for
- Developers writing README files and technical documentation
- Writers previewing notes and article drafts
- Students learning Markdown syntax
Real examples
Review a README before publishing
Paste headings, lists, fenced code, and tables to inspect hierarchy and readability. Sanitization removes unsafe HTML, so the preview can differ from platforms that allow custom elements or platform-specific Markdown extensions.
Prepare a portable article draft
Draft with common Markdown, then copy or download sanitized HTML for reference. Before publishing to a CMS, recheck links, image sources, code-language labels, and the exact Markdown features supported by that platform.
Good to know
- The preview is not uploaded or saved; refreshing the page removes the current draft.
- Sanitized HTML reduces script risk but cannot verify that external links or image sources are trustworthy.
- Markdown dialects differ, so perform a final preview in the destination platform before publishing.
FAQ
- Is raw HTML allowed?
- It can be parsed, but unsafe elements and attributes are removed before display.
- Is content saved?
- No. The content is lost when the page is refreshed.
Privacy & local processing
🔒 This tool runs entirely in your browser. No data is uploaded to any server.
All input and files are processed only in this browser tab and are not uploaded to a server.
Trust & usage note
This tool runs mainly in your browser. Your input is not actively uploaded to a server. Avoid entering highly sensitive data. Results are for reference only.
Last updated:
Get updates
New tools and practical tips, straight to your inbox. No spam, unsubscribe anytime.