Base64 Encoder & Decoder
Convert text to Base64 and back, with full Unicode support. Runs entirely in your browser — nothing is uploaded.
About Base64 Encode / Decode
Base64 converts arbitrary data into a 64-character alphabet that survives being sent through systems built for plain text. This tool encodes and decodes in both directions, handles accented characters and emoji correctly, and can produce URL-safe output for use in links and tokens.
Base64 exists because a great deal of infrastructure assumes text. Email bodies, JSON strings, HTML attributes, cookies and URLs were never designed to carry raw bytes, and a stray null or newline can corrupt a payload in transit. Encoding into letters, digits and a couple of symbols sidesteps the problem entirely, at the cost of making the data roughly a third larger.
The variant matters more than people expect. Standard Base64 uses plus and slash, both of which have special meaning inside a URL, so the URL-safe variant swaps them for hyphen and underscore and usually drops the trailing equals padding. JSON Web Tokens use exactly this variant, which is why a JWT segment pasted into a strict standard decoder often fails. This tool accepts either form when decoding, and lets you pick when encoding.
It is worth being clear about what Base64 is not. It is an encoding, not encryption — anyone can reverse it instantly, as this page demonstrates. Base64 provides no confidentiality whatsoever, so credentials or personal data that happen to be Base64-encoded are effectively in the clear.
How to encode and decode Base64
- Choose Encode to go from text to Base64, or Decode to go the other way.
- Paste your text or Base64 string into the input box.
- For encoding, tick URL-safe if the result will be used in a link or a token.
- Click the button to convert.
- Copy the result, or press Swap to feed it straight back in and round-trip it.
Tips & common problems
Unicode needs UTF-8 first
The browser's raw btoa function fails on any character above U+00FF, so accented letters and emoji break naive encoders. This tool converts to UTF-8 bytes first, so 'café' and emoji encode correctly.
Decoding failures are usually truncation
Base64 length must be a multiple of four once padded. If a string will not decode, the most common cause is that it was cut off when copied, or that line breaks were introduced by an email client.
Base64 is not security
It is trivially reversible and offers no protection at all. Never treat an encoded secret as a hidden one — if it needs to stay private, it needs encryption.
Expect it to grow by about a third
Every three bytes become four characters, so encoded data is roughly 33% larger. That is worth remembering before embedding a large image as a data URI.
Frequently asked questions
Is Base64 a form of encryption?
No. It is a reversible encoding with no key and no secrecy — anyone can decode it in seconds. Use it for safe transport of data, never for protecting it.
Does this work with emoji and accented characters?
Yes. Text is converted to UTF-8 before encoding, so characters outside the basic Latin range are handled correctly in both directions.
What is URL-safe Base64?
A variant that replaces the plus and slash characters with hyphen and underscore, and usually omits the equals padding, so the result can appear in a URL or a token without being escaped.
Why won't my Base64 string decode?
Most often it was truncated during copying, or contains stray whitespace or line breaks. This decoder strips whitespace and accepts both standard and URL-safe input, so remaining failures usually mean the string is incomplete.
Is my data sent to a server?
No. Encoding and decoding run entirely in your browser and nothing is transmitted or stored.
Can I encode a file, not just text?
This page handles text. To get a hash of a file instead, use the Hash Generator, which accepts file input directly.