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

FieldTypeRequiredWhat it is
themestringNolight, dark, or plain
markdownstringYesMarkdown text to convert

Output fields

How reliably each field appears in a successful answer.

FieldTypeAppears
htmlstringAlways (present in every successful answer)
themestringAlways (present in every successful answer)
body_htmlstringAlways (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
  }'

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