Base64 Encoder Decoder

Encode and decode Base64 — with Unicode handled correctly, in your browser.

Runs on your deviceDeveloperWorkingNo account needed

What this tool does

Base64 represents arbitrary bytes using 64 printable characters, so binary data can travel through channels that only reliably carry text: email bodies, JSON strings, data URIs, HTTP headers and configuration files.

It is an encoding, not encryption. Base64 provides no confidentiality whatsoever — anyone can decode it in seconds, as this page demonstrates. Its purpose is safe transport, and treating it as a security measure is a common and serious mistake.

The Unicode handling is the part naive implementations get wrong. The browser's built-in btoa only accepts characters below U+0100, so anything with an accent, a CJK character or an emoji throws an error. This tool converts to UTF-8 bytes first, so text in any language round-trips correctly.

How to use it

  1. Paste your text or Base64. Direction defaults to Detect: input that parses as Base64 is decoded, anything else is encoded. Force it with the Encode or Decode setting when the guess goes the wrong way.
  2. Choose the alphabet and wrapping. Encoding offers the standard alphabet with + / and = padding, or the URL-safe alphabet using - and _ with padding dropped. Output can stay on one line or wrap every 64 or 76 characters for MIME.
  3. Read the result. Decoded output is shown as UTF-8 text, or as hex bytes if you switch Decoded output to Hex — useful when the payload is not text at all.
  4. Copy it. Take the result straight to the clipboard.

Processing & privacy

Runs on your device. Your file is processed directly in this browser.

Common use cases

Reading a Basic Auth header

Decode the credentials portion to check which username a client is actually sending.

Building a data URI

Encode a small asset so it can be inlined into CSS or HTML without a separate request.

Inspecting a config value

Kubernetes secrets and many CI systems store values Base64-encoded; decoding shows what is really set.

Debugging an API

Confirm that an encoded field decodes to what you expect, particularly with non-English text.

Questions

Is Base64 secure?
No. It is an encoding, not encryption, and offers no protection at all. Anyone who sees the string can decode it instantly. Never use it to hide passwords, keys or personal data.
Is my input sent anywhere?
No. Encoding and decoding run in this tab. That matters because Base64 strings frequently contain credentials — an Authorization header or a Kubernetes secret should never be pasted into a remote service.
Why does my emoji or accented text fail elsewhere but work here?
Because the browser's raw btoa only handles characters below U+0100. This tool converts your text to UTF-8 bytes first, so any language round-trips correctly.
What are the trailing = characters?
Padding. Base64 works in three-byte groups, and = marks how many bytes the final group was short. Padding is optional on the way in here — it is stripped before decoding — and the URL-safe alphabet omits it on the way out.
What about URL-safe Base64?
Pick URL-safe under Alphabet to produce it: + and / become - and _, as JWTs use. Decoding needs no setting at all, because - and _ are translated back automatically.
Can I encode a file?
Not here. This is a text box: it takes typed or pasted characters, not an uploaded file. To inline an image as a data URI, use the Image to Base64 tool instead.
Why did my plain text get decoded instead of encoded?
Detect mode has to guess, and short words made only of Base64 characters — or a hex string like deadbeef — satisfy the test and get decoded to nonsense. Set Direction to Encode to remove the ambiguity.

Related tools