← all tools / quick utilities

Base64 Encoder and Decoder

Live

Paste text to get Base64, or paste Base64 to read it back. Both directions run inside this page, so nothing you paste is sent anywhere.

0 bytes in · 0 characters out. Everything stays in your browser.

What it does

  • Encode and decode in one box, switching direction as you go
  • Accepts line breaks, missing padding, and the URL-safe alphabet
  • Handles accents and emoji correctly, because it encodes UTF-8

Your files

It never leaves your device.

This one runs entirely in your browser. Nothing you type or drop here is sent to us, so there is nothing on our server to keep, and nothing to delete. It works offline once the page has loaded.

Frequently asked questions

Is Base64 a way of encrypting something?

No, and this is the mistake worth avoiding. Base64 is an encoding, not encryption: there is no key and no secret, and anyone who has the string can turn it back into the original in seconds, on this page or any other. It exists so that data survives channels that only expect plain text, such as email attachments or a JSON field. Never use it to hide a password or anything else that matters.

Is my text uploaded to your server?

No. The encoding and decoding both happen in your browser, in JavaScript that the page has already downloaded, so nothing you type or paste is sent to us. There is therefore nothing on our server to keep and nothing to delete. Once the page has loaded you can turn off the network entirely and it still works.

Why is the Base64 longer than the text I started with?

Base64 turns every 3 bytes into 4 printable characters, so the result is about 33 percent bigger than the input, plus up to two padding characters at the end. That is the price of the format: it can only use 64 characters that survive being sent through systems which would mangle raw bytes. If a file grew after being Base64 encoded, nothing has gone wrong.

What is URL-safe Base64, and do I need it?

Standard Base64 uses + and /, which both have their own meaning inside a URL, so a second form of the alphabet swaps them for - and _ and usually drops the = padding. JSON Web Tokens use it, and so do many APIs that pass data in a query string. Tick the URL-safe box when you are encoding for one of those. You never need it for decoding: this page accepts either alphabet and works out which one it is looking at.

Why does it say my Base64 is not valid?

Three things cause it. A character outside the alphabet, which the message names for you, usually means something extra was copied along with the string. A single character left over at the end means the string was cut short: Base64 turns every 3 bytes into 4 characters, so a final block of one cannot exist. And a string that decodes to bytes which are not text means it was carrying a file rather than words. Line breaks, spaces and missing padding are not problems: a final block of two or three characters is just padding that was dropped, and it is filled back in before decoding.

Can I Base64 an image or a PDF here?

Not on this page: it takes typed or pasted text, not a file. You can paste the Base64 part of a data URI in to inspect it, and the prefix is ignored, but if the bytes turn out to be an image, or any other file whose bytes are not text, the page tells you so rather than printing nonsense. The exception is a PDF saved without compression, whose source really is plain text: that one decodes, and what you get back is the PDF's own markup. A file-to-Base64 tool may follow later.

More Quick utilities tools

all tools