Markdown (GFM) to HTML API

github-label

Transform Markdown (GFM) into pretty HTML string, click here to preview full features.

Usage

Just send a POST request to the API with the markdown content in the body.

Node.js

const api = 'https://md2html.viki.moe'

// or use the deno deploy domain
// const api = 'https://markdown2html.deno.dev'

const markdownContent = `# Hello world
## H2
### H3`

const res = await fetch(api, {
  method: 'POST',
  body: markdownContent,
})

const htmlString = res.text()

console.log(htmlString)

Python

import requests

api = 'https://md2html.viki.moe'

# or use the deno deploy domain
# api = 'https://markdown2html.deno.dev'

markdown_content = '''# Hello world
## H2
### H3'''

res = requests.post(api, data=markdown_content)

html_string = res.text

print(html_string)

Languages supporting syntax highlighting

bash, c, cpp, csharp, css, dart, diff, docker, git, go, http, ignore, ini, java, javascript, json, jsx, kotlin, less, nginx, python, rust, sass, scss, sql, toml, tsx, typescript, yaml, zig

⬅ back to API list


Markdown Render Preview

Heading 1

Main content. Bold Italic Link Code

Image

Heading 2

Heading 3 with Custom Anchor Id {#custom-id}

Heading 4

Heading 5
Heading 6

Task List

Table

Normal Table

Header 1 Header 2
Cell 1 Cell 2
Cell 3 Cell 4

Align Table

Header 1 Header 2 Header 3
Center Center Center
Cell 1 Cell 2 Cell 3

Plain URL text: https://example.com => https://example.com

Math

Block math:

y=x2y = x^2

Inline math: y=x2y = x^2

GitHub Styled Alert

Note

Highlights information that users should take into account, even when skimming.

Tip

Optional information to help a user be more successful.

Important

Crucial information necessary for users to succeed.

Warning

Critical content demanding immediate user attention due to potential risks.

Caution

Negative potential consequences of an action.

Code Block

import { useState } from 'react';

export function App() {
  const [count, setCount] = useState(0);

  return (
    <div>
      <p>You clicked {count} times</p>
      <button onClick={() => setCount(count + 1)}>Click me</button>
    </div>
  );
}
fn main() {
    println!("Hello, world!");
}
def hello():
    print('Hello World')
console.log('Hello World');
{
  "name": "Vikash",
  "age": 25
}
+const a = 1;
-const b = 2;

Limited HTML Tags Support

Click to expand! Content inside details
Avatar
Tomato Text Lime Text Skyblue Text

Footnote

This is a footnote1.

Footnotes

  1. Footnote Content