Base64 Encoder & Decoder — text, files & images online
Encode text, files or images to Base64 and decode them back, with full Unicode support. Free online converter that runs entirely on your own machine.
About the Base64 encode / decode tool
Base64 exists to solve one specific problem: moving binary data through channels built only for text. Email headers, JSON payloads, URLs, XML documents, HTTP headers and configuration files all expect printable characters, and handing them raw bytes produces corruption or rejection. Base64 re-expresses any data using 64 safe characters, so it survives the journey intact and can be turned back into the original bytes at the other end.
You meet it constantly once you know the name. Email attachments are Base64 inside the message body. Small images inlined in CSS or HTML as data URIs are Base64. The header and payload of a JWT are Base64url. HTTP Basic authentication is a Base64 username and password. Kubernetes secrets, certificates in PEM format, and API keys embedded in configuration files all use it.
The single most important thing to understand is that Base64 is not encryption. It is an encoding — a reversible transformation with no key and no secret involved — so anything encoded can be decoded by anyone, instantly, with no special knowledge. A password stored in Base64 is stored in plain text with an extra step. It hides data from casual glancing and from nothing else, and treating it as security is a mistake made surprisingly often.
The cost is size. Every three bytes of input become four characters of output, so encoded data is about a third larger than the original, plus padding. That is why inlining a large image as a data URI is usually a poor trade, and why Base64 belongs in places where the channel demands text rather than being used by default. When the transport can carry binary safely, sending binary is strictly better.
How it works
Choose a direction
Encode to turn text or a file into Base64, or decode to turn Base64 back into what it was.
Paste or drop your input
Text, a file or an image all work. Everything is processed on your own device, never uploaded.
Copy the result
The output appears immediately. Invalid Base64 is reported rather than silently producing nonsense.
Frequently asked questions
- Is Base64 a form of encryption?
- No, and this is the most consequential misunderstanding about it. Base64 is a reversible encoding with no key — anyone can decode it in seconds. It provides no confidentiality whatsoever. If you need data kept secret, encrypt it; if you need it verified, sign or hash it. Base64 only makes binary data safe to carry through a text-only channel.
- Why does my decoded text come out as gibberish?
- Usually because it was not text to begin with — decoding an encoded image or compressed file produces raw bytes, which display as nonsense. Otherwise the string may be Base64url rather than standard Base64, using - and _ where standard uses + and /, or the padding = characters at the end may have been stripped somewhere in transit.
- What is Base64url and how is it different?
- A variant that replaces the + and / characters with - and _, because the standard ones have special meaning in URLs and would need percent-encoding. Padding is often omitted too. JWTs use it, as do many web APIs. The encoded data is otherwise identical, so converting between the two variants is a matter of substituting those two characters.
- Why is the encoded output larger than the original?
- Because 64 characters can only carry six bits each, so three bytes of input require four output characters — roughly a 33 percent increase, plus up to two padding characters. This is inherent to the encoding and cannot be avoided. It is the main reason not to Base64 large files unless the channel genuinely requires text.
- Does it handle Unicode and emoji correctly?
- Yes. Text is converted to UTF-8 bytes before encoding and back afterwards, so accented characters, Vietnamese, Chinese, Arabic and emoji all round-trip intact. Naive implementations that skip the UTF-8 step corrupt anything outside basic Latin, which is why encoded non-English text from some tools comes back mangled.
- Can I encode an image to use in CSS or HTML?
- Yes — encode the image file and prefix the result with a data URI header such as data:image/png;base64, and it can be embedded directly in a stylesheet or an img tag. It is worth doing for small icons, where it saves an HTTP request. For anything sizeable the 33 percent size penalty and the loss of separate caching usually outweigh the benefit.
- Is my data uploaded anywhere?
- No. Encoding and decoding both happen in your browser tab, so nothing crosses the network. This matters because the things people decode are frequently JWTs, Kubernetes secrets, Basic auth headers and certificates — real credentials. Pasting those into a site that transmits them would be handing them to a stranger.
