# 402utils Markdown to Safe HTML Converter

> 402utils Markdown to Safe HTML Converter is a paid API for AI agents from 402utils.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-11).

Converts GitHub Flavored Markdown to sanitized, XSS-safe HTML with a strict tag/attribute allowlist, removing scripts, styles, iframes, and dangerous URLs.

## Facts

- Endpoint: POST https://402utils.com/v1/md-to-html?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/402utils-markdown-to-safe-html-converter-492d3698
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_LAXYEsLRe7yII68b7fFBM

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability 402utils-markdown-to-safe-html-converter-492d3698 -d '<json body>'
```

Example prompt: Convert this markdown to safe HTML I can embed directly in an email — it includes a table, some task list items, and fenced code blocks: '## Summary\n| Col1 | Col2 |\n|------|------|\n| A | B |\n\n- [x] Done\n\n```js\nconsole.log("hi");\n```'

## When to prefer this

Use this endpoint when you need to safely render user-generated or untrusted markdown into HTML for embedding in web pages, emails, or apps, and XSS safety is a requirement. Ideal when GitHub Flavored Markdown features like tables, task lists, strikethrough, and fenced code blocks need to be supported. Prefer over generic markdown libraries when you need a server-side, hosted, pay-per-call solution with a strict security allowlist already built in.

## Known failure modes

- Input exceeds 2 MB limit — request rejected
- Malformed JSON body without 'markdown' key — parsing error
- Invalid Content-Type not matching JSON or text/markdown — may cause parse failure
- Payment not included or insufficient USDC — 402 payment required response
- Network timeout for very large markdown inputs near the size limit

## How this service works

Convert Markdown to sanitized HTML that is safe to embed directly in a page, email or app. GFM supported: tables, task lists, strikethrough, fenced code. Output passes a strict tag/attribute allowlist: scripts, styles, iframes, event handlers and javascript: URLs are removed; links keep only http(s)/mailto targets, images only http(s) or base64 image data URIs. Send JSON {markdown} or a raw text/markdown body, max 2 MB. Returns {html}.

## Output

Returns a JSON object {html} containing the sanitized HTML string derived from the input markdown, with scripts, styles, iframes, event handlers, and javascript: URLs removed, and links/images restricted to safe URL schemes.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "markdown": {
   "type": "string",
   "description": "Markdown source (GitHub Flavored Markdown). Max 2 MB UTF-8."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "html": "<h1>Release notes</h1>\n<ul>\n<li><input checked=\"\" disabled=\"\" type=\"checkbox\"> Ship the <em>v2</em> API</li>\n<li><input disabled=\"\" type=\"checkbox\"> Update docs</li>\n</ul>\n<table>\n<thead>\n<tr>\n<th align=\"left\">Feature</th>\n<th align=\"right\">Status</th>\n</tr>\n</thead>\n<tbody><tr>\n<td align=\"left\">Auth</td>\n<td align=\"right\">done</td>\n</tr>\n</tbody></table>\n<p><del>Old plan</del> — see <a href=\"https://example.com/docs\">the docs</a>.</p>\n"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/402utils-markdown-to-safe-html-converter-492d3698/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 402utils.com](https://www.zero.xyz/host/402utils.com/llms.txt)
