How to use it
- Choose Encode, Decode or File to Base64.
- Type or paste your text, or pick a file.
- Copy the result, or download decoded binary data as a file.
What Base64 is and where you see it
Base64 is a way to write any binary data using only 64 safe characters: A–Z, a–z, 0–9, + and /, with = used as padding at the end. Every 3 bytes of input become 4 characters of output, so Base64 text is about 33% larger than the original.
You run into Base64 all the time as a developer:
- Data URIs in HTML and CSS, such as
data:image/png;base64,iVBORw0… - Email attachments (MIME) and some API payloads
- HTTP Basic authentication headers (
Authorization: Basic dXNlcjpwYXNz) - JSON Web Tokens, which use the URL-safe variant for each part
- Keys and certificates in PEM files
Everything is converted in your browser. Your text and files are never uploaded to a server.
Encode, decode and file modes
| Mode | Input | Output |
|---|---|---|
| Encode | Any text, including accents and emoji | Base64 string (optionally URL-safe) |
| Decode | A Base64 string | Readable text, or a downloadable file if the data is binary |
| File to Base64 | Any file up to 20 MB | Plain Base64 or a ready-to-paste data URI |
Text is always encoded as UTF-8, so characters like é, ñ, ü or emoji round-trip correctly. Older tools that call btoa() directly fail on these characters; this one does not.
When you decode something that is not valid text, the tool tells you it is binary data, guesses the file type from its first bytes (PNG, JPG, GIF, WebP, PDF or ZIP), and lets you download it with the right extension.
Base64 vs. Base64URL
Standard Base64 uses + and /, which have special meanings in URLs and file names. The URL-safe variant (Base64URL) replaces them with - and _ and usually drops the = padding. JWTs and many web APIs use it.
- To produce it, tick URL-safe variant in Encode mode.
- To decode it, just paste it. The decoder accepts both alphabets, missing
=padding, spaces and line breaks, and even a leadingdata:…;base64,prefix.
Example: the text Hello, world! becomes SGVsbG8sIHdvcmxkIQ== in standard Base64 and SGVsbG8sIHdvcmxkIQ in Base64URL.
Embedding images as data URIs
In File to Base64 mode, keep As a data URI ticked to get a string you can paste straight into code:
- HTML:
<img src="data:image/png;base64,…"> - CSS:
background-image: url("data:image/svg+xml;base64,…")
Data URIs save an HTTP request, which helps for tiny icons and inline SVGs. For anything larger than a few kilobytes, a normal image file is usually better: Base64 adds a third to the size, cannot be cached separately and makes your HTML or CSS harder to read. To shrink an image before embedding it, compress it first.
Common mistakes
- Treating Base64 as encryption. It is an encoding, not a cipher. Anyone can decode it in a second, so never use it to hide passwords or secrets.
- Copying only part of the string. A Base64 string whose length is off by one character cannot be decoded; the tool tells you when the length looks wrong.
- Mixing up line breaks. Some tools wrap Base64 at 76 characters. That is fine here: whitespace is ignored when decoding.
- Decoding twice. If the output still looks like Base64, the data may have been encoded twice. Paste the result back in and decode again.
Frequently asked questions
Is Base64 encryption?
No. Base64 is a reversible encoding that anyone can decode. Use real encryption, such as AES, if you need to protect data.
Why is my Base64 longer than the original?
Base64 turns every 3 bytes into 4 characters, so the output is about 33% larger, plus up to two = padding characters.
Does it handle accented characters and emoji?
Yes. Text is encoded as UTF-8 before conversion, so accented letters, non-Latin scripts and emoji decode back exactly.
Can I decode a Base64 image?
Yes. Paste the string, with or without the data: prefix. If it is binary, the tool detects the type and offers it as a download.
What is the file size limit?
Files up to 20 MB can be converted. Larger files would produce Base64 text too long to work with comfortably.
Is my data uploaded?
No. Encoding and decoding run entirely in your browser.
Last updated: November 12, 2026