โ All Tools
Base64 Encoder & Decoder
Encode text to Base64 or decode Base64 strings online. Free, instant, and private.
What is Base64 Encoding?
Base64 is a binary-to-text encoding scheme that converts binary data into a sequence of printable ASCII characters. It uses a 64-character alphabet (A-Z, a-z, 0-9, +, /) to represent data, with = used for padding. Developers frequently encounter Base64 when working with APIs, authentication headers, and data URIs. The encoding increases data size by approximately 33%, but guarantees safe transmission across systems that only support text.
How to Use This Tool
- To encode: Paste your plain text in the left panel and click "Encode โ". The Base64 output appears on the right.
- To decode: Paste a Base64 string in the right panel and click "โ Decode". The original text appears on the left.
- Copy the result using the "Copy Output" button, or clear both fields to start fresh.
Common Use Cases for Developers
- Data URIs: Embedding small images directly in CSS or HTML using
data:image/png;base64,...to reduce HTTP requests. - API Authentication: HTTP Basic Auth requires credentials encoded as
Base64(username:password)in the Authorization header. - JWT Tokens: The header and payload sections of JWTs are Base64URL-encoded JSON objects.
- Email Attachments: MIME encoding uses Base64 to safely transmit binary files through email protocols.
- Binary in JSON: Since JSON doesn't support binary data, files and buffers are often Base64-encoded before embedding in payloads.
Tips & FAQ
- Base64 is not encryption. It's trivially reversible โ never use it to "secure" sensitive data. Anyone can decode it instantly.
- Base64URL vs standard Base64: URLs use a modified alphabet replacing + with - and / with _ to avoid URL-encoding issues. This tool uses standard Base64.
- Handling Unicode: This tool correctly handles multi-byte characters (emoji, accented letters) by encoding through UTF-8 first, unlike the basic
btoa()function which fails on non-ASCII input.