Base64 Encode / Decode

Encode any text as Base64, or decode a Base64 string back to readable text. Unicode-safe, with an optional URL-safe alphabet.

Input




Output

Base64 is handled as UTF-8, so non-English text and emoji encode and decode correctly.

Runs locally in your browser. Nothing is uploaded.

What is Base64?

Base64 is a way of representing arbitrary bytes using only 64 safe characters: the letters A–Z and a–z, the digits 0–9, plus + and /, with = as padding at the end. It exists because many older systems — email, URLs, configuration files, JSON payloads — only reliably carry plain text. Encoding binary data or special characters into this restricted alphabet lets it travel through text-only channels without being mangled. A classic use is embedding a small image inside an HTML or CSS file as a data URL, and another is carrying tokens and credentials inside HTTP headers and API requests.

Two things about Base64 are often misunderstood. First, it is not encryption: anyone who receives a Base64 string can decode it in one click, so it provides zero secrecy and must never be treated as protection for passwords or keys. Second, the standard alphabet is not URL-safe, because + and / have special meanings inside URLs. The URL-safe variant swaps them for - and _ and usually drops the = padding; it is common in web tokens and link parameters. This tool supports both alphabets: tick the URL-safe checkbox when encoding for a URL or token, and decoding accepts either alphabet automatically.

How to use the Base64 encoder / decoder

Paste your text into the input box and click Base64 encode, or paste a Base64 string and click Base64 decode. The result appears in the output box, ready to copy. If you need the URL-safe form, tick the checkbox before encoding; when decoding, the tool detects and accepts both alphabets, and it also tolerates missing padding. The Swap button moves the output back into the input box, which is handy for chained operations — for example, decoding twice in a row. The encoder is Unicode-safe: text is first converted to UTF-8 bytes, so accented characters, Chinese, Arabic, and emoji all round-trip correctly instead of producing errors or mojibake.

Frequently asked questions

Is Base64 encryption?
No. Base64 is only an encoding. Anyone can decode it instantly, so it offers no confidentiality at all. Never rely on it to hide passwords, keys, or other sensitive content.

Why does decoding fail with "not valid Base64"?
The usual causes are a missing trailing = padding character, stray characters mixed in during copying, or a string that is actually the URL-safe variant. This tool accepts the URL-safe alphabet and restores missing padding automatically, so if it still fails, check for truncated or mistyped characters.

What is the difference between standard and URL-safe Base64?
Standard Base64 uses + and / plus = padding. URL-safe Base64 replaces + with - and / with _, and normally omits the padding, so the string can sit safely inside a URL or token without extra escaping.

Can I encode a file with this tool?
This tool encodes text only. For images and other files, use the companion Base64 to Image / Image to Base64 tool, which reads files directly and produces data URLs.

Related tools

Base64 to Image / Image to Base64 · URL Encode / Decode · Hash Generator · JWT Decoder

Runs locally in your browser. Nothing is uploaded. How our privacy works

© 2026 TinyLabTools · tinylabtools.com