Encoding images & PDFs

How to convert a copied image to Base64 on a Mac

You can do this with B64 without ever writing a file. Here is how paste-to-convert works and when it is the right way in.

Plenty of images never become files. A picture copied out of a document, a frame lifted from a preview, a graphic copied from another app — the usual routine is to save it somewhere, convert it, and then remember to delete the file you only created as a stepping stone.

B64 skips that. Paste Image encodes whatever picture is on the clipboard directly.

Paste and convert

  1. Copy the image

    From wherever it is: a document, a preview, another app, or a screenshot taken with ⌃ held so it goes to the clipboard rather than to a file.

  2. Paste it into Encode

    Switch to Encode (⌘1) and press ⇧⌘V, or click Paste Image. The Base64 appears immediately.

  3. Take the result

    Choose your output format above the result, then Copy (⇧⌘C) or Export… (⌘E).

What ends up being encoded

The clipboard can hold the same picture in several representations at once, and what you get depends on what the app you copied from put there. In practice a pasted image is encoded as PNG — lossless, and the right choice for interface graphics, diagrams and anything with sharp edges.

The Inspector (⌥⌘I) confirms it: it shows the MIME type, the pixel dimensions and the size of what was actually encoded. Glance at it when the source matters.

When the original file matters more

Pasting encodes the picture as it sits on the clipboard, which is not always the original file. If you need the exact bytes of a specific JPEG — its compression, its EXIF, its checksum — load the file itself with ⌘O rather than copying and pasting it.

Making it a one-keystroke job

Two settings in B64 ▸ Settings… ▸ General turn this into a single interaction:

  • Default output format. Set it to whichever of the five you actually use and you never touch the menu.
  • Copy after encoding. The result goes straight onto the clipboard, so pasting the image in and pasting the string out is the whole task.

With both on, the sequence is: copy the picture, press ⇧⌘V, go paste the string wherever it was going.

Troubleshooting

Paste Image is doing nothing

There is no image on the clipboard. Copying a file in the Finder puts a file reference there, not a picture — drag that file onto the Encode area instead, or open it with ⌘O.

The pasted image is not the resolution I expected

Some apps put a display-sized version on the clipboard rather than the original. Check the dimensions in the Inspector; if they are wrong, go back to the source file and load that.

I wanted a JPEG and got a PNG

The clipboard representation decided that, not the app. Load the original .jpg file directly to encode the JPEG bytes themselves.

  • Drag and drop a file from the Finder onto the Encode area.
  • ⌘O to choose a file in the usual way.
  • Batch (⌘3) for a folder at a time.

Frequently asked questions

What format does a pasted image get encoded as?

PNG in practice, which is lossless and right for interface graphics and diagrams. The Inspector shows the MIME type of what was actually encoded.

Why does copying a file in the Finder not work?

That puts a file reference on the clipboard rather than a picture. Drag the file onto the Encode area instead, or open it with Command O.

Can I get the exact bytes of the original file this way?

Not necessarily — pasting encodes the clipboard's representation. When the original file's compression, metadata or checksum matter, load the file itself.

Is there a way to make this a single keystroke?

Yes. Set your default output format and switch on copy after encoding in Settings, and Shift Command V becomes the whole task.