🧩

Markup Convert

Convert between markup formats (Markdown, HTML, plain text).

GET 1 credit /v1/convert/markup
curl "https://convert.toolkitapi.io/v1/convert/markup?url=https://toolkitapi.io/doc.md&from_format=markdown&to_format=html"
import httpx

resp = httpx.get(
    "https://convert.toolkitapi.io/v1/convert/markup?url=https://toolkitapi.io/doc.md&from_format=markdown&to_format=html",
)
print(resp.json())
const resp = await fetch("https://convert.toolkitapi.io/v1/convert/markup?url=https://toolkitapi.io/doc.md&from_format=markdown&to_format=html", {
});
const data = await resp.json();
console.log(data);
# See curl example
Response 200 OK
{
  "result": "<h1>Hello</h1>\n<p>World</p>",
  "metadata": {"word_count": 2, "toc": [{"level": 1, "text": "Hello"}]}
}

Try It Live

Live Demo

Description

Convert between markup formats (Markdown, HTML, plain text).

How to Use

1

1. Call this endpoint with `from_format`, `to_format`, and either `content` (inline) or `url`.

2

2. Optionally set flags: `gfm` for GitHub Flavored Markdown, `sanitize` for HTML safety, `preserve_links` and `preserve_tables` for text output.

3

3. Read the `result` string from the response.

About This Tool

Markup Convert is the unified endpoint for moving between `markdown`, `html`, and plain `text`. Supply inline `content` or a public `url`; the result is returned as a JSON `result` string together with `metadata` (word count, table of contents, etc.).

Conversions support GitHub Flavored Markdown, HTML sanitization, and options to preserve links and table structure when downgrading to plain text.

Why Use This Tool

Frequently Asked Questions

Is the HTML output safe to render?
When `sanitize=true` (the default for Markdown → HTML), script tags, event handlers, and other unsafe constructs are removed.
What Markdown flavour is used?
CommonMark is the base. `gfm=true` adds tables, task lists, strikethrough, and autolinks.
Can I convert plain text to Markdown?
Not directly — `from_format` accepts `markdown` or `html` only. Treat plain text as Markdown (it renders as paragraphs) if needed.

Start using Markup Convert now

Get your free API key and make your first request in under a minute.