Back to templates

Template details

Showdown

A bidirectional Markdown to HTML to Markdown converter written in Javascript

About this template

Showdown is a free, open-source JavaScript library that converts Markdown text into HTML in both browsers and Node.js, built on John Gruber's original Markdown syntax.

What is Showdown?

Showdown is a JavaScript Markdown-to-HTML converter that runs client-side in the browser or server-side with Node.js. It takes Markdown text as input and produces HTML fragments or full HTML documents as output. The library is released under the MIT license since v2.0 (earlier versions under BSD) and is maintained by the showdownjs community led by Andre Pena (tivie). It is based on the original Markdown implementation by John Gruber.

Key Features

  • Dual environment support — Works in browsers, Node.js, and even CDN installs; tested on Firefox 1.5+, Chrome 12+, Internet Explorer 6+, Safari 2+, Opera 8.54+, and Konqueror 3.5.4.
  • Configurable options — Over 30 options including tables, tasklists, emoji, strikethrough, ghMentions, simpleLineBreaks, parseImgDimensions, and headerIds to control output behavior.
  • Flavors — Built-in presets for original Markdown, vanilla (showdown base), GFM (GitHub Flavored Markdown), and CommonMark (since v3.0.0).
  • Security options — safeMode blocks dangerous URL schemes like javascript: and vbscript:, and escapes raw HTML tags/event handlers; disallowRawHTML applies GFM's disallowed raw HTML tagfilter.
  • Extensions system — Load third-party extensions or create your own using the provided boilerplate repo to add custom syntax.
  • CLI tool — Ships with a command-line interface for converting Markdown files to HTML from the terminal.
  • Integrations — Official AngularJS plugin (ngShowdown), TypeScript types via DefinitelyTyped, SystemJS plugin (system-md), and Vue component (vue-showdown).
  • Metadata support — Option to parse document metadata delimited by ««« and »»» or --- lines, accessible via getMetadata().

Who is it for?

  • Web developers — Embed a Markdown editor preview in web apps, converting user input to HTML on the client side without a server round-trip.
  • Node.js backend developers — Generate HTML from Markdown server-side for CMS content, static site generation, or API responses.
  • Open-source project maintainers — Use it as the rendering engine for project documentation or discussion platforms, as seen in Meteor and StackExchange (which forked it as PageDown).
  • Static site builders — Combine it with tools like md-page to render Markdown directly in the browser.

What can you do with Showdown?

  • Build a live Markdown editor: instantiate a Converter and call makeHtml on each keystroke to render a preview pane.
  • Convert user-generated content: sanitize and render comments or forum posts by enabling safeMode and running output through DOMPurify.
  • Generate HTML from Markdown files: use the bundled CLI tool to convert .md files to .html files in bulk.
  • Create custom extensions: write a plugin to add emoji shortcodes, footnotes, or other specialized syntax for your project.

How does Showdown work?

Showdown's core API is a Converter object. You create a new converter (optionally passing options or extensions), then call converter.makeHtml(markdownText) to get an HTML string. Options can be set globally with showdown.setOption or per-instance via the constructor or setOption. Flavors are applied similarly with setFlavor.

Example in Node.js:

var showdown = require('showdown');
var converter = new showdown.Converter();
var html = converter.makeHtml('# hello, markdown!');
// html: <h1 id="hello-markdown">hello, markdown!</h1>

Pricing

Showdown is free and open-source software. It is released under the MIT license from v2.0 onward and remains free forever; earlier versions are under BSD. The project accepts donations via PayPal but there are no paid tiers or premium features.

Alternatives

  • marked — A JavaScript Markdown parser focused on speed and low-level customization, often used where minimal overhead is needed.
  • markdown-it — A highly extensible Markdown parser with a large plugin ecosystem, popular in Node.js and browser bundlers.
  • PageDown — A fork of Showdown used by StackExchange for its editor preview.

FAQ

Is Showdown free?

Yes. Showdown is free, open-source, and will remain free forever. Versions 2.0 and later are released under the MIT license; older versions use the BSD license. You can donate via PayPal to support development.

How do I use Showdown in the browser?

Include the showdown.min.js file from a CDN like jsDelivr, cdnjs, or unpkg, then instantiate a new showdown.Converter() and call makeHtml with your Markdown string. No build step is required — it works in browsers supporting ECMA 262 3rd Edition.

Does Showdown support GitHub Flavored Markdown?

Yes. You can set the gfm flavor globally or per-converter to enable GFM features such as tables, tasklists, strikethrough, and simplified autolinks. A github alias is available for backward compatibility.

What is safeMode in Showdown?

safeMode is an opt-in security option added in v3.0.0. It blocks dangerous URL schemes like javascript: and vbscript: in links and images, escapes raw HTML tags, and strips inline event handlers such as onerror and onload. It is defense-in-depth only, not a full HTML sanitizer.

Does Showdown sanitize HTML output?

No. By default, Showdown does not sanitize input, which can allow XSS if you feed it untrusted Markdown. The README recommends enabling safeMode, running the output through a dedicated sanitizer like DOMPurify, and serving a Content-Security-Policy.

screenshot of Showdown on template0.com