Markdown to HTML
Turn Markdown into styled HTML with inline CSS, in a light, dark or plain theme.
Pay by wallet (x402)
markdown-to-html Example
Example answer
{
"html": "<!DOCTYPE html>\n<html lang=\"en\">\n<head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><style>body{font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;line-height:1.6;max-width:800px;margin:0 auto;padding:2rem}\ncode{font-family:\"SF Mono\",Monaco,Consolas,monospace;font-size:0.9em;padding:0.2em 0.4em;border-radius:3px}\npre{padding:1rem;border-radius:6px;overflow-x:auto}pre code{padding:0}\nblockquote{border-left:4px solid;padding-left:1rem;margin-left:0}\nimg{max-width:100%;height:auto}\ntable{border-collapse:collapse;width:100%}th,td{border:1px solid;padding:0.5rem;text-align:left}\nhr{border:none;border-top:1px solid}\nbody{background:#fff;color:#333}a{color:#0366d6}code{background:#f6f8fa}pre{background:#f6f8fa}blockquote{border-color:#dfe2e5;color:#6a737d}th,td{border-color:#ddd}hr{border-color:#eee}</style></head>\n<body><h1>Hello World</h1>\n\n<p>This is a <strong>test</strong> document.</p></body>\n</html>",
"theme": "light",
"body_html": "<h1>Hello World</h1>\n\n<p>This is a <strong>test</strong> document.</p>"
} Inputs
| Field | Type | Required | What it is |
|---|---|---|---|
theme | string | No | light, dark, or plain |
markdown | string | Yes | Markdown text to convert |
Output fields
How reliably each field appears in a successful answer.
| Field | Type | Appears |
|---|---|---|
html | string | Always (present in every successful answer) |
theme | string | Always (present in every successful answer) |
body_html | string | Always (present in every successful answer) |
How to call it
The same tool through each route. MCP clients reach it through Strale’s server at https://api.strale.io/mcp; the call below is what the agent sends.
# Needs an API key. max_price_cents caps what this call may cost.
curl -X POST https://api.strale.io/v1/do \
-H "Authorization: Bearer $STRALE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"capability_slug": "markdown-to-html",
"inputs": {
"markdown": "# Hello World\n\nThis is a **test** document."
},
"max_price_cents": 2
}' {
"tool": "strale_execute",
"arguments": {
"slug": "markdown-to-html",
"inputs": {
"markdown": "# Hello World\n\nThis is a **test** document."
},
"max_price_cents": 2
}
} import { Strale } from "straleio";
const strale = new Strale({ apiKey: process.env.STRALE_API_KEY! });
const result = await strale.do({
capability_slug: "markdown-to-html",
inputs: {
"markdown": "# Hello World\n\nThis is a **test** document."
},
max_price_cents: 2,
}); import os
from straleio import Strale, DoRequest
strale = Strale(api_key=os.environ["STRALE_API_KEY"])
result = strale.do(DoRequest(
capability_slug="markdown-to-html",
inputs={
"markdown": "# Hello World\n\nThis is a **test** document.",
},
max_price_cents=2,
)) # No account. The first request answers 402 with the price in USDC;
# an x402 client pays it from your wallet and repeats the request.
curl -i 'https://api.strale.io/x402/v2/markdown-to-html?markdown=%23+Hello+World%0A%0AThis+is+a+**test**+document.' Limitations
Some GitHub Markdown extensions may not render
Converts standard CommonMark syntax — GitHub-flavored extensions (task lists, tables) may not all be supported
What to do instead: Check if your markdown uses GFM extensions and test the output for table and task list rendering
Related tools
- HTML to PDF €0.10
- Image Resize €0.03
- Image to Text (OCR) €0.05
- Scanned Document OCR €0.10
- URL to Base64 €0.02