Base64 Encoder and Decoder
Convert plain text into a Base64 string, or decode a Base64 string back to readable text.
About the Base64 encoder
Base64 represents binary data as a safe set of text characters so it can travel through systems that only handle text. This BapTools tool encodes text to Base64 and decodes it back, entirely inside your browser.
What is Base64 used for?
- In HTML: embedding small images inline with
src="data:image/png;base64,...". - In email: placing images inside a message without attachments.
- In JSON: encoding binary strings such as API keys or digital signatures.
- In transfer protocols: moving data over text-only channels.
Is Base64 secure encryption?
No. Base64 is an encoding, not encryption - anyone holding the string can decode it. Never use it to protect passwords or sensitive data.
Real-world examples
Example 1 — "Bap" becomes a Base64 string
Type Bap and press Encode to get QmFw. Decoding it again returns exactly "Bap".
Example 2 — a truncated string
A 100-character string is not always pasted intact through email or chat. Decoding reports an error straight away, which flags the problem instead of failing quietly.
Example 3 — embedding a small icon in HTML
Encode a small icon, paste it into src="data:image/png;base64,...", and the image renders without a separate file request.
Example 4 — tokens carrying binary data
Some APIs return Base64 tokens containing keys or signatures. Decoding lets you read the payload when you need to inspect it.
When to use it, and when not to
Worth using
- Decoding a Base64 string you found in a log, an HTTP header or an API payload.
- Moving binary data through a text-only channel such as email.
- Embedding small images or files directly in CSS and HTML.
- Learning how Base64 works, for example why a data URI image is always larger than the file.
Not worth it
- Protecting a password or sensitive value. This is encoding, not encryption, and anyone with the string can decode it.
- Compressing files. The output is usually larger than the original, so use a real compressor.
- Encoding data that must be signed or authenticated, which needs a proper crypto library.
How to use it
- Paste the text you want to convert into the input area.
- Press Encode to produce a Base64 string.
- Or press Decode if you have a Base64 string to read back.
- Press Copy result to copy the output.
Frequently asked questions
How is Base64 different from encryption?
Encryption needs a key. Base64 has no key at all, so anyone can decode it. Use it to transport data, never to secure it.
Is Base64 longer than the original?
Yes, by roughly 33%, because every 3 bytes of source data becomes 4 characters.
Is there a length limit?
There is no fixed limit, but very long strings can slow down the browser.