How to use the Base64 tool
Choose Encode to turn text into Base64, or Decode to turn Base64 back into readable text. Output updates as you type. Use Swap to move the output into the input and reverse the direction — handy for checking a round trip.
How Base64 works
Base64 takes input bytes three at a time (24 bits) and splits them into four 6-bit groups. Each 6-bit value (0–63) maps to one character from the alphabet A–Z a–z 0–9 + /. If the input isn't a multiple of three bytes, the output is padded with =.
Example
The text Man is the bytes 77, 97, 110 → binary 010011 010110 000101 101110 → values 19, 22, 5, 46 → TWFu.
Full UTF-8 support
The browser's built-in btoa() fails on characters outside Latin-1, such as Hindi, Tamil or emoji. This tool converts text to UTF-8 bytes first, so नमस्ते and 👋 encode and decode correctly — the same result you'd get from base64 on Linux or Python's base64.b64encode(text.encode("utf-8")).
Common uses of Base64
- Data URLs — embedding small images in HTML or CSS (
data:image/png;base64,…). - HTTP Basic Auth — the
Authorizationheader carriesusername:passwordin Base64. - JWTs — the header and payload are Base64URL-encoded JSON.
- Email attachments — MIME encodes binary attachments as Base64.
- APIs — sending files or binary blobs inside JSON bodies.
Base64 vs. Base64URL
Standard Base64 uses +, / and =, which have special meanings in URLs. Base64URL swaps them for - and _ and omits padding. The decoder here accepts both formats automatically.
Decoding a token? The JWT decoder splits and decodes all parts for you. For percent-encoding, see the URL encoder.
Frequently asked questions
What is Base64 encoding?
Base64 represents binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, + and /). It's used to safely carry binary or special-character data through systems designed for text, such as email, JSON and URLs.
Is Base64 encryption?
No. Base64 is an encoding, not encryption — anyone can decode it instantly. Never use Base64 to protect passwords or sensitive data.
What is URL-safe Base64?
URL-safe Base64 (Base64URL) replaces + with - and / with _, and usually drops the = padding, so the output can be used in URLs and filenames without escaping. JWTs use Base64URL.
Why does Base64 make data bigger?
Base64 encodes every 3 bytes as 4 characters, so encoded output is about 33% larger than the original.
Last updated: 22 September 2026Suggest an improvement · Report a problem
