HTML Formatter & Viewer
Formatted output will appear here...Last updated:
This tool is provided as-is for convenience. Output should be verified before use in any production or critical context.
Programmatic Access
HTML Formatter & Viewer is also callable as a free HTTP JSON API at
https://aidevhub.io/api/html-formatter/ — GET with query
parameters or POST with a JSON body, no authentication, CORS enabled,
50 requests/day per IP. Responses return
{ ok, tool, result, meta }.
curl -s -X POST https://aidevhub.io/api/html-formatter/ \
-H "Content-Type: application/json" \
-d '{"html":"<div><p>Hello</p><span>world</span></div>","mode":"format"}' Machine-readable contract: /api/tool/html-formatter.json All API endpoints: /agents/ LLM site index: /llms.txt
Agent Invocation
Best Path For Builders
Dedicated API endpoint
Deterministic outputs, machine-safe contracts, and production-ready examples.
Dedicated API
https://aidevhub.io/api/html-formatter/ OpenAPI: https://aidevhub.io/api/openapi.yaml
Unified Runtime API
https://aidevhub.io/api/tools/run/?toolId=html-formatter&a=...
GET and POST are supported at /api/tools/run/ with identical validation and limits.
Limit: 30 req / 60s, input max 256 KB.
How to Use HTML Formatter & Viewer
- 1
Paste your HTML
Copy your HTML code (minified or unformatted) into the textarea. Handles HTML fragments and complete documents.
- 2
View formatted output
Formatted HTML appears instantly in the right panel with proper indentation, line breaks, and spacing. Syntax highlighting shows structure.
- 3
Check for errors
View error count at the top. Errors show with line numbers and messages (unclosed tags, invalid nesting, deprecated elements).
- 4
Copy or download
Click 'Copy' to copy formatted HTML to clipboard. Click 'Download' to save as .html file for your project.