htmlpreview.github.io alternative: share an HTML file from GitHub as a page
htmlpreview.github.io renders an HTML file from a public GitHub repo in the browser. It is free and needs no setup. Here is how it works, where it breaks, and when a hosted link fits better.
Open an .html file on GitHub and you see source code, not the page. GitHub serves raw files as plain text, so the browser shows the markup instead of running it. htmlpreview.github.io is a free, open-source workaround: put its address in front of the file’s GitHub URL and it renders the page.
How htmlpreview works
The link looks like htmlpreview.github.io/?https://github.com/user/repo/blob/main/index.html. A script on that page rewrites the address to the raw.githubusercontent.com copy of the file, fetches it, and writes it into the page. Stylesheets and scripts that also live in the repo are fetched the same way and injected. If the direct fetch fails, it retries through a third-party CORS proxy, api.codetabs.com. It also accepts Bitbucket URLs.
Nothing is uploaded or stored. Every visit fetches the current file from the repo.
Where it breaks
- ✓Private repos: the fetch carries no GitHub login, so files in a private repo do not load.
- ✓Scripts: they are pulled out of the page and re-run after the HTML is written, so pages that depend on script order or load events can behave differently than they do on a normal server.
- ✓Dependence on others: rendering relies on raw.githubusercontent.com and, as a fallback, a proxy run by a third party.
- ✓The person you send it to needs nothing, but you need the file in a public GitHub repo first, which is a step for anyone who does not use Git.
- ✓There is no way to see who opened the link or to collect feedback on the page.
Sharing the same file on FileShare Pro
Drag the .html file onto the dashboard and you get a link that serves it as a normal web page over HTTPS. No repo, no Git, and the file can stay private to you while the link is shared. Shared pages carry a noindex tag, so search engines do not list them.
Upload a new version over the old one and the link stays the same: updating a shared link without changing it. Turn on comments and anyone with the link can pin a note to a spot on the page after typing a name, no account: letting people comment on a web page. You can also see when the link was opened.
If the file already lives on GitHub and you want a permanent public site, GitHub Pages is the better fit than either tool: FileShare Pro vs. GitHub Pages.
Choosing between them
- ✓The file is in a public repo and you want a quick look at it rendered → htmlpreview, no setup.
- ✓The file is in a private repo, or not on GitHub at all → FileShare Pro.
- ✓You want feedback pinned to the page, or to know it was opened → FileShare Pro.
- ✓You want a lasting public site built from the repo → GitHub Pages.
Frequently asked
A free, open-source page that fetches an HTML file from a public GitHub or Bitbucket repo and renders it in your browser, instead of the source code GitHub shows.
No. It fetches the raw file without your GitHub login, so files in private repos fail to load.
It re-runs scripts after writing the HTML and loads assets through its own fetch, so pages that rely on script order, load events or relative paths outside the repo can render differently than on a real server.
Download the file and upload it to a host that serves HTML as a page, such as FileShare Pro. The link works for anyone you send it to while the repo stays private.
Yes. The free plan hosts up to 50 files with guest comments included.
Drop the file, copy the link — live in seconds, free plan included.
Start sharing free