Markdown to HTML Converter
Convert Markdown to HTML in your browser, review safe preview output, and catch raw HTML, external-link, parser, and size warnings before reuse.Conversion result
Conversion result
- {{ warning }}
{{ outputHtml }}
| Check | Value | Detail | Copy |
|---|---|---|---|
| {{ row.check }} | {{ row.value }} | {{ row.detail }} |
Markdown earns its place in documentation because it remains readable before a browser ever sees it. A release note, README, support article, or changelog can be drafted in plain text, reviewed in version control, and then translated into HTML for a publishing system. The conversion step is where readable writing becomes real browser markup: headings turn into heading elements, lists gain list tags, links become anchors, and code fences become preformatted blocks.
The difficulty is that Markdown is a family of related rules, not one universal format. CommonMark gives a stricter core model for paragraphs, lists, block quotes, code, links, and inline emphasis. GitHub-flavored Markdown builds on that model with common documentation features such as tables, task lists, and strikethrough. A source file that looks fine in one renderer can lose table structure, change line breaks, or treat raw HTML differently in another.
| Publishing Situation | Decision That Changes the Result | Risk to Check |
|---|---|---|
| Repository README | Whether the destination expects GFM extensions such as tables and task lists. | A table or checklist may fall back to plain text when the flavor is wrong. |
| CMS body field | Whether the destination wants an HTML fragment rather than a complete document. | Doctype, head, body, or style tags may be rejected by a snippet field. |
| Help article showing code | Whether raw tags should render as HTML or appear as escaped text. | A literal tag example may become a live element if it is not escaped. |
| Public release note | How external links should open and what relationship attributes they should carry. | Outbound links may need opener protection, nofollow treatment, or removal as links. |
Raw HTML is the point where a simple text conversion becomes a safety decision. Markdown allows authors to write HTML-looking tags in the source, but publishing them without review can preserve unsafe elements, unwanted attributes, or links that behave differently from ordinary Markdown anchors. Sanitizing, escaping, stripping, and keeping raw tags are not interchangeable choices. Each one answers a different question about whether the original text is trusted and whether the final destination expects those tags.
A converted document is safest when it is treated as a review handoff rather than a final publishing guarantee. The generated markup should be checked against the preview and the conversion notes, then tested in the system that will display it. Destination sanitizers, CSS, link policies, and Markdown extensions can still change how the same content appears after it is pasted elsewhere.
How to Use This Tool:
Choose the parsing and safety settings first, then use the preview and ledger as the proof check before copying or downloading HTML.
- Add content in Markdown source, drop a file on the editor, or use Browse MD for one
.md,.markdown, or.txtfile under 2 MB. Use Load sample when you want a known table, task list, code block, and external link to compare against. - Set Markdown flavor. Use GitHub-flavored Markdown when tables, task lists, or strikethrough are part of the source. Use CommonMark core when the destination follows the stricter core syntax.
- Choose HTML safety. Sanitizing is the normal review choice for copied or mixed text. Escape raw HTML when tags should appear as examples, strip raw tags when Markdown alone should create elements, and keep trusted raw HTML only for controlled source text.
- Choose Link policy. Preserve links keeps parser-provided anchors, safe external links add opener protection, nofollow mode adds a nofollow relationship, and plain-text external links remove clickable outbound anchors.
- Pick Output scope and Output formatting. Use a fragment for CMS fields and page sections, or a full HTML document when the result needs doctype, head, body, and optional readable CSS. Pretty output is easier to inspect, while compact output is shorter.
- Open Advanced only when heading IDs, soft line breaks, or standalone document CSS need to change. Heading IDs are useful for anchor links, tables of contents, and repeated section titles.
- Check HTML Markup, Rendered Preview, and Conversion Ledger together. Treat raw-HTML, parser, sanitizer, empty-source, or link warnings as stop-and-review cues before reusing the result.
If a file is rejected, use a supported Markdown or text extension under 2 MB, or paste the text directly into the source field.
Interpreting Results:
HTML Markup is the copyable result. Rendered Preview shows the generated fragment after it has been cleaned for browser display. Conversion Ledger records the parser profile, safety choice, link policy, source size, output footprint, block counts, headings, tables, task-list items, code blocks, links, media, and warnings.
A clean preview is not enough by itself. A destination CMS may remove attributes, rewrite links, ignore heading IDs, or style task lists and tables differently. The ledger helps catch those issues early because it shows whether the expected structures were detected and whether any safety warning changed the result.
Use the JSON tab when a review record needs the selected settings, metrics, warnings, ledger rows, generated HTML, and sanitized preview HTML in one structured artifact.
Technical Details:
Markdown conversion first identifies block structure, then resolves inline markup inside those blocks. The block pass decides whether lines form headings, paragraphs, lists, tables, fenced code blocks, block quotes, or horizontal rules. The inline pass handles emphasis, code spans, links, images, strikethrough, and text escapes. Changing the Markdown flavor changes which patterns are recognized before HTML is assembled.
Safety processing is separate from parsing. Raw HTML can be escaped before parsing, stripped before parsing, allowed through the parser and then sanitized, or kept in the generated markup when the source is trusted. The rendered preview is still cleaned before display, so trusted raw output and visible preview can differ on purpose.
Transformation Core:
| Stage | Rule | Review Cue |
|---|---|---|
| Normalize text | Line endings are normalized, and leading invisible marks that interfere with parsing are removed. | Source line, word, character, and UTF-8 byte counts appear in the ledger. |
| Apply raw HTML policy | Raw tags are sanitized, escaped, stripped, or preserved according to the selected safety choice. | Raw-tag warnings appear when HTML-looking tags reach the sanitizing path. |
| Parse Markdown | GFM mode enables common extensions when supported; CommonMark core keeps extension behavior tighter. | The parser profile reports which conversion path produced the markup. |
| Post-process structure | Heading IDs can be generated from heading text, and repeated headings receive numbered suffixes. | The ledger reports heading anchors and block coverage. |
| Handle links | External HTTP and HTTPS links can be preserved, opened with protective relationship attributes, given a nofollow relationship, or replaced by visible text. | Link counts and external-link policy details appear in the ledger. |
| Shape output | The result can remain an HTML fragment or become a full document, and it can be formatted for review or compact transport. | HTML footprint reports character and byte size after formatting. |
Safety and Link Policy Map:
| Choice | Output Behavior | Best Fit |
|---|---|---|
| Sanitize generated HTML | Generated markup is cleaned before output and preview. | Copied, mixed, or not fully trusted Markdown. |
| Escape raw HTML as text | Raw tags become visible escaped characters before Markdown parsing. | Tutorials, code examples, or docs that should show tags literally. |
| Strip raw HTML tags | HTML-looking tags are removed before Markdown parsing. | Handoffs where only Markdown syntax should create HTML elements. |
| Keep trusted raw HTML | Raw tags can remain in the generated markup, while the preview is still cleaned for display. | Controlled source text that intentionally includes supported HTML. |
| Open external links safely | External anchors open in a new context with opener protection. | Public outbound links that should not reuse the current browsing context. |
| Plain-text external links | External anchors are replaced by their visible text. | Review copies where outbound links should no longer be clickable. |
Worked Transformation Path:
A release note with # Version 2.1, two task-list items, a Markdown table, a fenced JavaScript block, and an external documentation link needs GFM mode if the checklist and table should become real HTML structures. With heading IDs enabled, the heading receives a slug-style anchor. With safe external links enabled, the documentation anchor keeps its text and target URL while gaining protective relationship attributes.
Heading IDs are built from heading text by lowercasing it, removing accent marks, replacing non-alphanumeric runs with hyphens, trimming extra hyphens, and adding numbered suffixes when the same heading appears more than once. That keeps repeated section titles such as Install or Examples from producing duplicate anchors.
Privacy Notes:
Pasted Markdown and accepted local files are converted in the browser. The file picker reads supported files locally, and copy or download actions happen only when you trigger them. Avoid putting secrets in Markdown when the generated HTML, ledger, or JSON record will be copied, downloaded, or shared.
Worked Examples:
README fragment with tables and tasks
A README section contains # Install, a dependency table, two task-list items, a fenced shell block, and a link to hosted documentation. Use GitHub-flavored Markdown, sanitize generated HTML, and open external links safely. The markup should include the table and code block, while the ledger should count the heading, table rows, task-list items, code block, and external link.
Article that displays tags as text
A help article needs to show <aside> and <script> examples without rendering them. Choose Escape raw HTML as text before converting. The preview should show the tag characters, and the HTML markup should contain escaped text rather than live elements.
External vendor link review
A copied CMS note includes an external vendor link that should not remain clickable. Choose Plain-text external links, then check the ledger and preview. The visible label should remain, but the external anchor should be replaced by text.
File rejected during upload
A dropped file fails with a type or size message. Export or rename the content as .md, .markdown, or .txt under 2 MB, or open the file elsewhere and paste the Markdown text into Markdown source.
FAQ:
Why does the same Markdown render differently elsewhere?
Markdown flavors and destination sanitizers differ. Use GFM for table and task-list support, or CommonMark core when stricter syntax is required, then test a small sample in the final publishing system.
Should I ever keep trusted raw HTML?
Keep trusted raw HTML only when the source is controlled and the destination expects those tags. For copied, user-provided, or mixed content, sanitize, escape, or strip raw HTML instead.
Why can Rendered Preview differ from HTML Markup?
The preview is cleaned before display. In trusted raw HTML mode, HTML Markup may preserve tags that the preview removes or changes for safer viewing.
What files can I load?
The file picker and drop area accept one .md, .markdown, or .txt file under 2 MB. Unsupported files can be opened elsewhere and pasted as text.
When should I choose a full HTML document?
Choose Full HTML document when the result needs doctype, head, body, and optional readable CSS. Choose HTML fragment for CMS fields, page sections, and embedded content areas.
Glossary:
- Markdown flavor
- The rule set used to parse Markdown syntax and supported extensions.
- CommonMark
- A core Markdown specification intended to reduce parser differences.
- GitHub-flavored Markdown
- A Markdown flavor that extends CommonMark with tables, task lists, strikethrough, and related behavior.
- HTML fragment
- Reusable markup without doctype, head, or body wrappers.
- Raw HTML
- HTML-looking tags written directly inside Markdown text.
- Sanitize
- Clean generated HTML so unsafe tags, attributes, or URL values are removed before use.
- Heading ID
- An anchor attribute generated from heading text for links and tables of contents.
- Conversion Ledger
- The result table that records settings, structure counts, output size, and review notes.
References:
- CommonMark Spec, CommonMark, version 0.31.2, January 28, 2024.
- GitHub Flavored Markdown Spec, GitHub, version 0.29-gfm, April 6, 2019.
- Cross Site Scripting (XSS), OWASP Foundation.
- HTML Standard link types, WHATWG.