Base64 encoder and decoder

Base64 rewrites arbitrary data using only letters, digits and a couple of symbols, so it can travel through channels that expect text — a JSON field, a data URI in a stylesheet, an email attachment header, a Kubernetes secret. This tool converts in both directions, for typed text and for whole files, and can produce the URL-safe variant that swaps the two characters a query string would otherwise mangle. It runs locally, which is the point: the strings people decode are usually tokens, keys and secrets, and pasting those into a site that posts them to a server hands them over.

How to encode and decode base64

  1. Choose Text to type or paste a value, or File to convert a file from your device.
  2. Switch between Encode and Decode. In text mode the result updates as you type.
  3. Turn on "URL safe" if the value will sit in a URL or a filename — it replaces the + and / characters and drops the trailing padding.
  4. Copy the result, or in file mode download the decoded bytes back to a file.

Questions about base64

Is my data sent anywhere?

No. Encoding and decoding use your browser's own functions inside the page. Nothing is logged or transmitted, which is why it is safe to decode a token here.

Is base64 a form of encryption?

No, and this matters. It is an encoding, not a cipher — anyone can reverse it instantly with no key. Never treat a base64 string as a way to hide a password or a secret; it only changes the alphabet, not the readability.

What does URL-safe mean?

Standard base64 uses + and /, which have their own meaning inside a URL, and = padding, which is often stripped. The URL-safe variant writes those as - and _ and omits the padding, so the value survives being placed in a query string, a path or a filename. This tool accepts both when decoding.

Why is my encoded file bigger than the original?

Base64 represents three bytes with four characters, so the output is about 33 percent larger, plus any line breaks. That overhead is the price of being able to send binary data through a text-only channel.

Why did decoding say the result is not text?

Because the bytes are not valid UTF-8 — you decoded something binary, such as an image or a PDF. Switch to file mode, which writes those bytes to a file instead of trying to display them.

Other tools

Languages