Text Sharing Tool - Free Paste Bin for Code Snippets
Share text and code online with this free browser tool. It offers syntax highlighting for ten languages, optional link expiration, and needs no account.
Text Sharing Tool
Documentation
Text Sharing Tool (Paste Bin)
A text sharing tool, often called a paste bin, is a web page for posting a block of text or code and getting back a link that shows that text to anyone who opens it. This paste bin tool runs entirely in the browser, needs no account, and can add optional syntax highlighting and an expiration time to the link.
How the text sharing tool works
Most paste bin services store the text on a server and hand back a short link that points to a database row. This tool works differently. It has no server and no database. Instead, it packs the whole paste into the link itself.
When someone clicks "Create Link," the tool does four things:
- It builds a small object holding the text, the chosen language, and the expiration time (or nothing, for "never").
- It converts that object to a line of JSON text.
- It turns the JSON into bytes, using the UTF-8 encoding that the web uses everywhere.
- It encodes those bytes as base64url, a scheme that turns arbitrary bytes into letters, digits,
-, and_, so the result is safe inside a URL.
The encoded text is placed after #p= at the end of the page's URL. Everything after the # is called the fragment. A browser never sends the fragment to a server when it loads a page, so the paste's content is never transmitted anywhere. Reading the link back is the same process in reverse: decode the base64url text, turn the bytes back into a JSON string with UTF-8, and parse the JSON to recover the text, language, and expiration time.
Because the fragment carries the full paste, a share link works on any device or browser, not just the one that created it. Nothing needs to be looked up. Opening the link is enough to display the content, the same way opening a downloaded file doesn't require asking a server what the file contains.
The tool also keeps a local copy of each paste in the browser's storage as a convenience draft. That copy only helps the same browser find its own past pastes again; it plays no part in how a shared link is opened, and clearing it does not break any share link, because the link never depended on it.
Syntax highlighting
Syntax highlighting colors the parts of code, such as keywords, strings, and comments, so the structure is easier to read. The tool supports ten options:
- Plain Text (no highlighting)
- JavaScript
- TypeScript
- Python
- Java
- HTML
- CSS
- JSON
- SQL
- Bash
The chosen language is stored inside the encoded payload, so the highlighting is applied automatically when the link is opened, without the viewer choosing anything.
Expiration formula
An expiration option sets an absolute timestamp, measured in milliseconds since 1 January 1970 (a common computing reference point called the Unix epoch). The tool adds a fixed length of time to the moment the link is created:
| Option | Added time |
|---|---|
| Never | no timestamp is stored |
| 1 Hour | 60 × 60 × 1,000 ms |
| 1 Day | 24 × 60 × 60 × 1,000 ms |
| 1 Week | 7 × 24 × 60 × 60 × 1,000 ms |
| 1 Month | 30 × 24 × 60 × 60 × 1,000 ms (a fixed 30 days, not a calendar month) |
For example, if a link is created when the clock reads 1,700,000,000,000 ms and the creator picks "1 Week," the stored expiration is:
1,700,000,000,000 + (7 × 24 × 60 × 60 × 1,000) = 1,700,604,800,000 ms
When a viewer opens the link, the tool compares that stored timestamp with the current time. If the stored time has already passed, the tool shows a "This content has expired" message instead of the text. Because the expiration timestamp travels inside the link along with the text, this check works the same way on any device.
Worked example: how a paste becomes a link
Suppose someone shares the plain text Hello, world! with no expiration. The tool builds this JSON object, using short field names to keep the link compact:
1{"t":"Hello, world!","l":"plaintext","e":null}
2It encodes that JSON as UTF-8 bytes, then as base64url, producing:
1eyJ0IjoiSGVsbG8sIHdvcmxkISIsImwiOiJwbGFpbnRleHQiLCJlIjpudWxsfQ
2The full share link is the page address plus that token after #p=:
1https://whiz.tools/en/development/paste-bin-tool#p=eyJ0IjoiSGVsbG8sIHdvcmxkISIsImwiOiJwbGFpbnRleHQiLCJlIjpudWxsfQ
2Anyone who opens that link gets a browser that decodes the token, reads back Hello, world! as plain text, and displays it. No server was ever asked for anything.
How to share text or code
- Type or paste the text into the text box. A character count updates as text is typed.
- Optionally pick a language from the syntax highlighting menu.
- Optionally pick how long the link should remain valid.
- Click "Create Link."
- Copy the generated link with the "Copy Link" button and send it however preferred.
How to view shared text
- Open the shared link.
- The text appears immediately, with highlighting if a language was chosen.
- Use "Copy Text" to copy the content to the clipboard.
- Use "Create New" to start a fresh paste.
A paste cannot be edited after the link is created. Changing the text requires making a new paste and sharing the new link.
Common uses
- Developers sharing a code snippet for review or debugging help.
- Teachers sharing starter code or instructions.
- Anyone moving a block of text, such as a list or a set of notes, between two of their own devices.
For text that needs to stay editable by several people at once, a shared document tool is a better fit. For code that needs a permanent history, a version control system such as Git is a better fit.
Limits and privacy
Because the entire paste lives inside the link, the practical size limit is the length of the URL itself, not any storage quota. Browsers can handle long URLs, but many email programs, chat apps, and older systems truncate or reject very long ones, so extremely large pastes may not travel well through every channel. Short and medium pastes are unaffected.
The fragment is never sent to a server, so the tool itself never learns what was pasted. Anyone who has the exact link can open it, so a link should be treated the same way as the text it contains: do not share passwords or other sensitive data this way, and do not post the link somewhere public if the content should stay private.
Frequently asked questions
Where is the shared text actually stored?
It is not stored anywhere separate from the link. The text, the chosen language, and the expiration time are all encoded directly into the link's fragment, the part after the #. The link itself is the only copy.
Does the link work on a different device or browser? Yes. Because the content travels inside the link, any device that opens it can decode and display the content. No account or original browser is required.
What happens if I clear my browser data? Nothing happens to existing share links. They do not depend on anything stored in the browser, only on the link itself. Clearing browser data only removes the local convenience copy the browser keeps of pastes created on that device.
Can I edit a paste after creating the link? No. A new link must be created for any change, since the content is baked into the link at creation time.
What happens when a paste expires? Opening an expired link shows a message that the content has expired, instead of the original text. The link itself still exists; it simply no longer displays the content once the stored expiration timestamp has passed.
Is there a size limit? There is no fixed storage limit, but very long URLs can be rejected or cut short by some email clients and messaging apps, so very large pastes are better suited to a dedicated file-sharing tool.
References
- "UTF-8." MDN Web Docs, Mozilla, https://developer.mozilla.org/en-US/docs/Glossary/UTF-8
- "Base64." MDN Web Docs, Mozilla, https://developer.mozilla.org/en-US/docs/Glossary/Base64
- "URL." MDN Web Docs, Mozilla, https://developer.mozilla.org/en-US/docs/Web/API/URL
- "Syntax highlighting." Wikipedia, Wikimedia Foundation, https://en.wikipedia.org/wiki/Syntax_highlighting
- "Unix time." Wikipedia, Wikimedia Foundation, https://en.wikipedia.org/wiki/Unix_time