Utilities

Pastebin

Paste code or text, pick a language, share via link — no account needed. 28 languages with live syntax highlighting.

chars words lines

Recent Pastes

About This Tool

Pastebin is a free, serverless code and text sharing tool. Paste anything — code, config, logs, notes — pick a language, and click Get Link to generate a shareable URL. No account, no sign-up, no expiry.

The share link is entirely self-contained: your paste is encoded directly in the URL hash using Base64. Anyone with the link can open it in their browser and see the highlighted code. Nothing is stored on a server — the link IS the paste.

28 programming languages are supported for syntax highlighting via Prism.js, including JavaScript, TypeScript, Python, Go, Rust, SQL, YAML, Markdown and more. Your recent pastes are saved to your browser's local storage so you can quickly return to them.

How to Use

  • Title — optional. Displayed in the browser tab and stored in the link. Helps you remember what the paste is about.
  • Language — select from the dropdown for syntax highlighting. Choose "Plain Text" for raw content with no colouring. The language selector also determines the download file extension (.js, .py, etc.).
  • Write tab — the editor. Type or paste code. The Tab key inserts 2 spaces instead of moving focus.
  • Preview tab — shows the syntax-highlighted version using Prism.js. Line numbers are shown. Switch back to Write to keep editing.
  • Get Link — encodes your title, language, and content into a URL hash and shows the share URL. Click the URL or "Copy Link" to copy it. Share it with anyone — the link opens directly into Preview mode.
  • Copy — copies the raw text content to your clipboard.
  • Download — saves the paste as a file with the correct extension for the selected language.
  • Recent Pastes — shown below the editor after you use Get Link. Click any entry to reopen it. History is per-browser and stored locally.

How Serverless Sharing Works

Traditional pastebins store content on a server and give you a short ID (e.g. pastebin.com/xZ3kA9). This tool takes a different approach: the content lives entirely in the URL hash.

When you click Get Link, the tool serializes your title, language, and content to JSON, encodes that JSON as a Base64 string using btoa(), and appends it to the page URL after a #. The resulting URL looks like pastebin.html#eyJ0aXRsZSI6....

When someone opens that link, the page reads window.location.hash, Base64-decodes it with atob(), parses the JSON, and renders the paste. No server roundtrip — the entire paste travels inside the URL itself.

Limitations: URL length is limited by browsers and servers. Most environments support URLs up to ~8,000 characters, which comfortably holds code snippets up to ~5 KB. Very large files won't share well via URL — use the Download button and share the file directly instead.

Report an Issue

Let us know what's wrong with Pastebin.

Thank you — report received!