Markdown to HTML
Turn Markdown into sanitized HTML, preview it, and export a fragment or full document.
1 lines · 0 chars
HTML will appear here…Runs locally in your browser. Nothing is uploaded or sent to a server.
Enter Markdown in Markdown Input or choose Open .md file to convert it to HTML automatically. Review the generated tags in Raw HTML, then select Preview to check the rendered content. Choose Fragment for an existing page or Full HTML document for a standalone file, then use Copy HTML or Download .html. Conversion and sanitization run in your browser. Tables, task lists, strikethrough, and fenced code are supported. Copy formatted copies the rendered fragment for rich text destinations; it does not copy the full document shell or the preview's stylesheet.
Updated
Related Tools
HTML to Markdown
Convert HTML locally, choose Markdown styles, and inspect table losses before saving.
developer-toolsJSON Formatter
Beautify or minify JSON, inspect its structure, and copy or download the result in your browser.
developer-toolsBase64 Encode / Decode
Convert text or files, repair Base64 padding, choose charsets, and process separate lines locally.
developer-toolsRegex Tester
Inspect JavaScript regex matches, preview replacements, and download repeatable test cases.
developer-toolsJSON to YAML
Keep exact numeric tokens, control string quoting, and check that YAML reads back as the same data.
developer-toolsHTML Minifier
Minify HTML instantly in your browser. Remove comments, collapse whitespace, and strip unnecessary characters. See size savings. 100% private.
How do you convert Markdown to HTML?
Enter your source in Markdown Input to generate HTML automatically. For example, # Release notes becomes <h1>Release notes</h1>, and **Ready** on a separate paragraph becomes <p><strong>Ready</strong></p>. Check Raw HTML for the tags and Preview for the rendered result, then choose how to copy or download it.
To try a complete example, paste the three lines below, including the blank line between the heading and paragraph. With Fragment selected, the output contains a heading and one paragraph. Select Full HTML document to wrap those same elements in a document whose title is Release notes. No manual conversion step is needed after editing.
# Release notes
**Ready** for review.
The resulting fragment is:
<h1>Release notes</h1>
<p><strong>Ready</strong> for review.</p>
Should you export a fragment or a full HTML document?
Use Fragment when a destination already supplies its own document structure, such as an HTML content field or a page template. It is the initial selection. Full HTML document adds a doctype and html, head, and body elements around the sanitized fragment. The wrapper includes UTF-8 character encoding and viewport metadata, but no stylesheet.
| Action | Fragment | Full HTML document |
|---|---|---|
| Raw HTML | Sanitized content tags | Document shell and content tags |
| Copy HTML | Fragment source | Complete document source |
| Download .html | Fragment saved as output.html | Complete document saved as output.html |
| Preview and Copy formatted | Rendered fragment | Rendered fragment, without the shell |
The document title uses the text of the first h1 heading, escaping special characters for the title element. If there is no h1, the fallback title is Markdown document. The generated html element uses lang="en"; there is no language selector. Review that attribute in your editor when preparing a document in another language.
Which Markdown syntax becomes which HTML tags?
The parser uses marked with GitHub Flavored Markdown enabled. Headings, paragraphs, emphasis, links, images, blockquotes, ordered and unordered lists, and horizontal rules are supported. Pipe tables become table markup with header and data cells. Task items such as - [x] Done render as checked checkboxes, while ~~removed~~ becomes <del>removed</del>. Recognized bare URLs become links.
Fenced code produces a pre element containing a code element. A language label such as javascript adds class="language-javascript" to the code element. This identifies the language without applying syntax highlighting. Inline backticks produce code spans instead. Use Sample to load headings, lists, a code block, a blockquote, and a table before trying your own source.
Why does a Markdown newline not become an HTML line break?
Automatic line breaks are disabled in the parser configuration. A single newline inside a paragraph remains a soft break rather than generating a br element. For an explicit hard break, end the line with two spaces or a backslash before the newline. To start a separate paragraph, insert a blank line instead.
This distinction matters when converting notes with one sentence per source line: their visual layout may become a continuous paragraph. Compare Raw HTML with Preview to identify the cause before adding spacing. A paragraph boundary creates separate p elements; a hard break creates br within the paragraph. These structures serve different purposes even when both introduce visible separation.
How are raw HTML and preview styling handled?
After parsing, DOMPurify sanitizes the generated HTML. Script elements, event handlers, and unsafe javascript: links are removed before the fragment reaches the output. Allowed HTML remains, so this is sanitization rather than escaping every tag. The Raw HTML tab shows the sanitized result too; switching tabs does not reveal an unsanitized export.
Preview renders the fragment using the tool's typography styles. Those styles are not embedded in copied markup or the downloaded document, so a destination can display the same headings, code, and tables differently. The full document wrapper also adds no CSS. Inspect the result in your publishing environment rather than treating the preview as a finished website or email template.
How do you open a Markdown file and copy the result?
Open .md file reads a selected local file as text into Markdown Input. The file picker accepts .md, .markdown, Markdown text, and plain text. Parsing and sanitization run in the browser. Paste reads clipboard text; if clipboard access fails, the tool tells you to focus the input and use Ctrl/Cmd+V. Clear empties the source.
Copy HTML copies the selected source format. Copy formatted supplies the fragment as HTML and rendered plain text when rich clipboard support is available, falling back to plain text otherwise. A receiving editor decides which representation to use. For the reverse task, use HTML to Markdown; browse Developer Tools for other source conversion tools.
How to Use Markdown to HTML
-
Markdown Input
Type or paste your source into Markdown Input, use Paste, or choose Open .md file to read a local Markdown file. Sample loads an example without changing any files.
-
Fragment or Full HTML document
Leave Fragment selected for markup to insert into an existing page. Choose Full HTML document to add the document shell and a title taken from the first h1 heading.
-
Raw HTML and Preview
Inspect tags in Raw HTML and switch to Preview to see the rendered fragment. Both update automatically as you edit; there is no conversion button.
-
Copy HTML, Copy formatted, or Download .html
Use Copy HTML for the selected source format, Copy formatted for rich text, or Download .html to save output.html. Copy formatted always uses the fragment.