HTML Formatter API - beautify or minify HTML
html_formatterFormat messy HTML with clean indentation (2 spaces, 4 spaces or tab) or minify HTML to a single compact string, with optional comment removal. Preserves script, style, pre and textarea content. Runs on our server, files are deleted right after the call, nothing stored. Free: 5 calls/day per IP. Paid: Radar API key (from €9/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.001/call via x402 at https://radarbg.com/x402/html-formatter.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"mode": "beautify",
"text": "<div><h1>Hello</h1><p>World</p></div>",
"indent": "2"
},
"name": "html_formatter"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | beautify or minify | beautify |
| text | Yes | Your HTML markup | |
| indent | No | Indentation: 2, 4 or tab | 2 |
| removeComments | No | Remove HTML comments |