Convert HTML code or an .html file into a portable, shareable URL directly in your browser. No upload, account, server, or build step is required.
Open the HTML to URL converter · Publish HTML with a permanent URL
This open-source HTML to URL converter stores a small HTML page inside the URL itself:
- The browser turns the HTML into UTF-8 bytes.
- Native gzip compression is used when it creates a shorter payload.
- The bytes are encoded with URL-safe Base64 and stored in the URL fragment.
viewer.htmldecodes the fragment and renders the page in a sandboxed iframe.
The URL fragment is not sent to the static host. The generated page can still request external images, fonts, scripts, and other resources referenced by the HTML.
- Paste HTML or upload an HTML file
- Live sandboxed preview
- Generate, copy, and open a portable HTML URL
- Automatic raw UTF-8 or native gzip encoding
- No dependencies, backend, database, analytics, or account
- Static deployment with GitHub Pages
- Responsive and keyboard-accessible interface
| Portable URL | Hosted HTMLtoURL page |
|---|---|
| HTML is stored in the link | HTML and assets are hosted online |
| Best for small experiments | Suitable for larger pages |
| Link changes with the content | Update content without changing the URL |
| No storage or account | Version, expiry, and traffic management |
| May be truncated by some apps | Short, durable sharing URL |
For a stable page that can be updated later, publish it with HTMLtoURL.
No installation is required. Serve the directory with any static server:
python -m http.server 4173Then open http://localhost:4173.
Run the codec tests with:
npm testGenerated HTML is rendered in an iframe with a restrictive sandbox attribute and without allow-same-origin. This isolates scripts in the shared page from the converter and viewer origins.
Portable pages can still load third-party resources and open sandboxed popups. Only open HTML URLs from people you trust. Read SECURITY.md before changing iframe sandbox permissions.
The converter uses CompressionStream and DecompressionStream when available. It falls back to uncompressed UTF-8 encoding when compression is unavailable or produces a longer URL.
Browsers and messaging apps enforce different URL limits. This project warns at 60,000 characters and blocks portable links above 180,000 characters. These thresholds are safeguards, not universal guarantees.
This repository is an independent open-source browser utility maintained by PXAny. It does not contain server-side publishing, accounts, storage, payments, or source code from the private HTMLtoURL application.