Skip to content

Repository files navigation

HTML to URL — Free Open Source Converter

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

What it does

This open-source HTML to URL converter stores a small HTML page inside the URL itself:

  1. The browser turns the HTML into UTF-8 bytes.
  2. Native gzip compression is used when it creates a shorter payload.
  3. The bytes are encoded with URL-safe Base64 and stored in the URL fragment.
  4. viewer.html decodes 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.

Features

  • 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 vs. hosted URL

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.

Run locally

No installation is required. Serve the directory with any static server:

python -m http.server 4173

Then open http://localhost:4173.

Run the codec tests with:

npm test

Security

Generated 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.

Browser and URL limits

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.

Project scope

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.

License

MIT

About

Free, open-source HTML to URL converter. Turn HTML code or files into shareable browser links—no server, upload, or tracking.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages