Search DevTools

Jump to any tool or page

Base64 Encoder & Decoder

Encode text or a file to Base64, or decode it back. Handles Unicode correctly and updates as you type.

Plain text

paste or upload

Base64

The result appears here as you type.

Developer Utilities

About Base64 Encoder/Decoder

Encode text or files to Base64 and decode them back. Base64 maps every three bytes onto four ASCII characters so binary data survives transports that only reliably carry text — email bodies, JSON string fields, data URIs, and HTTP headers.

Frequently asked questions

Is Base64 encryption?
No. Base64 is an encoding, fully reversible by anyone with no key involved. Its purpose is safe transport of binary data through text-only channels, not secrecy. Base64-encoding a password or API key offers zero protection — it is trivially decoded, and treating it as a security measure is a recurring source of credential leaks in config files and client-side bundles.
Why does encoded output end in one or two equals signs?
Base64 processes input in three-byte groups that map onto four output characters. When the input length is not divisible by three, the final group is padded: one leftover byte produces two characters plus '==', two leftover bytes produce three characters plus '='. The padding keeps the output length a multiple of four so decoders know where the data ends. Input lengths divisible by three need no padding at all.
What is Base64URL and when do I need it?
Standard Base64 uses + and / , both of which have reserved meanings in URLs — + can decode as a space in query strings and / is a path separator. Base64URL (RFC 4648 §5) substitutes - and _ respectively and usually drops the padding. JWTs, and most tokens appearing in URLs or filenames, use this variant. Feeding a Base64URL string to a strict standard decoder generally fails until those characters are translated back.
How much does Base64 increase size?
Roughly 33 percent, since every 3 bytes become 4 characters, plus padding and any line breaks. A 3 MB image becomes about 4 MB encoded. This is why inlining large assets as data URIs can hurt page performance: the payload grows by a third and, unlike a separate file, it cannot be cached independently or loaded in parallel with the document.
Does Base64 handle Unicode and emoji correctly?
Only if the text is converted to bytes first. Base64 encodes bytes, not characters, so the string must be serialised — normally as UTF-8 — before encoding. The legacy browser function btoa() throws an InvalidCharacterError on any character above U+00FF, which is why emoji and non-Latin scripts break naive implementations. The correct approach encodes via TextEncoder to UTF-8 bytes, then Base64-encodes the result.