TBToolbox
Text

Markdown to HTML

Markdown to HTML first escapes ampersands and less-than signs, then applies regular expressions for ATX headings at line starts, double-asterisk strong text, single-asterisk emphasis, HTTPS links, and blank-line paragraph boundaries. It is not a CommonMark parser: output is an HTML fragment, paragraphs are not consistently wrapped, lists/code/images/escapes/nesting are unsupported, replacement order can produce surprising markup, and generated HTML is not a full document.

Runs locally — files stay on your device
Quick answer

Does this implement full CommonMark?

No. It supports only a small regex-based subset.

Markdown parsing requires grammar, not independent regexes

Nested delimiters, escaping, code spans, blocks, links, and precedence interact; a conforming parser resolves those structures before rendering.

How it works

The runner HTML-escapes & and <, replaces heading lines, strong/emphasis spans, HTTPS Markdown links, and double newlines in a fixed order.

Key concepts

Fragment, not document

No html, head, body, or consistently enclosing paragraph is generated.

HTTPS links only

The link regex requires an https://-style destination covered by its pattern.

When to use it

  • Convert a small trusted note using supported syntax.
  • Preview simple headings and emphasis.
  • Create a basic HTML fragment for manual review.

When not to use it

  • Do not expect lists, code, images, tables, or full Markdown.
  • Do not assume every nested delimiter is parsed correctly.
  • Do not insert output into a security-sensitive sink without review.

Worked examples

Heading

Input
# Title
Expected output
<h1>Title</h1>

A supported line-start pattern.

Emphasis

Input
**bold** and *italic*
Expected output
strong and em elements

Simple delimiters convert.

List

Input
- one\n- two
Expected output
Literal hyphen lines

Lists are unsupported.

Common mistakes

Calling it CommonMark

Many constructs and edge cases are absent. Correction: Use a maintained Markdown parser.

Expecting full page HTML

Only a fragment is returned. Correction: Wrap through a document template.

Trusting complex nesting

Regex replacement order can misparse. Correction: Test or use a grammar parser.

Best practices

  • Use only the documented subset.
  • Inspect generated markup.
  • Use a standards-compliant parser and sanitizer for production content.

Related operations and differences

Add Prefix to Every Line

Choose Add Prefix to Every Line when you need to add the same prefix before every line.; use Markdown to HTML specifically for markdown.

Add Suffix to Every Line

Choose Add Suffix to Every Line when you need to add the same suffix after every line.; use Markdown to HTML specifically for markdown.

Capitalize Every Word

Choose Capitalize Every Word when you need to capitalize the first character of every word.; use Markdown to HTML specifically for markdown.

Character Counter

Choose Character Counter when you need to count Unicode characters in text.; use Markdown to HTML specifically for markdown.

Extract Email Addresses

Choose Extract Email Addresses when you need to find unique email addresses in text.; use Markdown to HTML specifically for markdown.

Extract URLs

Choose Extract URLs when you need to find unique HTTP and HTTPS links in text.; use Markdown to HTML specifically for markdown.

Limitations and privacy

  • Regex subset: headings, emphasis, HTTPS links, blank-line replacement.
  • No CommonMark compliance, lists, code, images, tables, blockquotes, robust nesting/escaping, full document, sanitizer, or DOM validation.

Text is transformed locally in this browser and is not uploaded by the tool.

Frequently asked questions

Are lists supported?

No.

Is output a full HTML document?

No.

Are raw angle brackets preserved?

Less-than signs are escaped before conversion.

Should this replace a production Markdown parser?

No.

References