Integrations

Three ways to get text into PasteKit from somewhere else: a bookmarklet for any web page, links that open the tool with content already loaded, and a badge for your README. None of them uploads anything — the content travels inside the link itself, in the part after the #, which browsers never send to any server.

Bookmarklet

Format with PasteKit← Drag this to your bookmarks bar (clicking it here does nothing).

Then, on any page, select some text and click the bookmark. PasteKit opens in a new tab with the selection loaded and its format detected. With nothing selected it takes the whole page's text, which is handy on a raw JSON, XML or YAML API response.

  • Sends nothing anywhere. The bookmarklet compresses the text in your browser and puts it in the new tab's URL fragment. It makes no network requests, and the fragment is never sent to our server or anyone else's.
  • Size. Works for anything up to roughly a megabyte of text; beyond that it asks you to copy and paste instead.
  • Browsers. Any current Chrome, Edge, Firefox or Safari. If popups are blocked it opens in the same tab.
Read the bookmarklet's source
void (async () => {
  const w = window, d = document;
  let s = String(w.getSelection() || '');
  if (!s.trim()) s = d.body ? d.body.innerText : '';
  if (!s.trim()) return w.alert('PasteKit: select some text first.');
  const z = new Blob([new TextEncoder().encode(JSON.stringify({ t: s, o: {} }))]).stream().pipeThrough(new CompressionStream('deflate-raw'));
  const b = new Uint8Array(await new Response(z).arrayBuffer());
  let x = '';
  for (let i = 0; i < b.length; i += 32768) x += String.fromCharCode(...b.subarray(i, i + 32768));
  const u = "https://pastekit.dev" + '/#v1;auto;' + btoa(x).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
  if (u.length > 2000000) return w.alert('PasteKit: this is too large for a link. Copy and paste it instead.');
  if (!w.open(u, '_blank')) w.location.href = u;
})();

Put a link in documentation, an issue or a chat message that opens PasteKit with an example already formatted. Choose a format (or let PasteKit detect it), then either paste the content — it is compressed into the link — or give the address of a public file, which the reader's browser fetches directly when they open the link.

Content links are checked for secrets (cloud keys, tokens, private keys, passwords) before they are created. Anyone who has the link can read what is in it.

Link formats

You can also build links yourself:

  • https://pastekit.dev/<tool-page>#v1;<format>;<payload> — the payload is the base64url of the raw-deflated JSON{"t": text, "o": {}}. Use the format auto on the home page to detect the format.
  • https://pastekit.dev/load?url=https%3A%2F%2Fraw.githubusercontent.com%2Fowner%2Frepo%2Fmain%2Fopenapi.yaml&back=/yaml-formatter — opens the YAML formatter with that file. The server must allow cross-origin requests (raw GitHub, Gists and most public APIs do).

README badge

Format with PasteKit

The badge is a small SVG served from this site — no third-party badge service sees your visitors. Point it at a content link from above, or at the tool:

[![Format with PasteKit](https://pastekit.dev/badge.svg)](https://pastekit.dev/)
<a href="https://pastekit.dev/"><img src="https://pastekit.dev/badge.svg" alt="Format with PasteKit" height="20"></a>