Instantly preview any GitHub-hosted
.htmlfile — no cloning, no local server.
GitHub HTML Viewer is a lightweight, zero-dependency tool that lets you paste any GitHub .html blob URL and renders it live in your browser — right inside the page.
GitHub shows raw HTML source by default. This tool fixes that.
Example input:
https://github.com/shanraisshan/claude-code-best-practice/blob/main/presentation/index.html
Output: Fully rendered HTML page, previewed instantly.
- ✅ Paste any
github.com/.../blob/.../file.htmlURL - ✅ Renders HTML live via sandboxed iframe
- ✅ Uses GitHub Contents API — no CORS issues
- ✅ Zero dependencies — single
.htmlfile - ✅ Press
Enteror click Render ▶ to load - ✅ Shows file size & fetch status
- Parses the GitHub blob URL to extract
owner,repo,branch, andpath - Fetches the file content via the GitHub Contents API (
api.github.com/repos/...) - Decodes the base64 response
- Injects the HTML into a sandboxed
<iframe>usingsrcdoc
GitHub Blob URL
↓
GitHub Contents API (CORS-friendly)
↓
Base64 decode
↓
<iframe srcdoc="..."> → Live Preview
No install needed. Just open index.html in any browser — or use the hosted version.
git clone https://github.com/ghviz/github-html-viewer.git
cd github-html-viewer
open index.html| Limitation | Detail |
|---|---|
| API rate limit | 60 requests/hour (unauthenticated) |
| Private repos | Not supported without a GitHub token |
| Relative assets | Images/CSS using relative paths may not load |
| Non-HTML files | Only .html files are supported |
PRs and issues are welcome! If you find a bug or have a feature idea, open an issue.
MIT © ghviz