Skip to content
brownie.tools

Markdown to HTML

Turn Markdown into sanitized HTML, preview it, and export a fragment or full document.

1 lines · 0 chars

HTML Output
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

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.

How the selected output format affects each action
ActionFragmentFull HTML document
Raw HTMLSanitized content tagsDocument shell and content tags
Copy HTMLFragment sourceComplete document source
Download .htmlFragment saved as output.htmlComplete document saved as output.html
Preview and Copy formattedRendered fragmentRendered 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

  1. 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.

  2. 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.

  3. 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.

  4. 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.

Frequently Asked Questions