Base64 Encoder & Decoder

Encode and decode Base64 — including text your other tools choke on.

34 B in, 48 characters out

Encode a file

Turn an image, PDF or any other file into Base64 for a data URL, an email attachment or an API request. The file is read in your browser and never uploaded.

About this tool

Convert text or a file to Base64 and back. Unlike tools that call btoa() directly, this encodes the UTF-8 bytes, so Devanagari, Chinese and emoji round-trip unchanged instead of throwing an error. Decoding accepts the URL-safe alphabet, missing padding, line breaks and a data: prefix, and tells you when the bytes are a file rather than text so you can download them. Everything runs in your browser.

Most quick Base64 tools call the browser’s btoa() straight on your text, which throws on the first character above the Latin range. That is why so many of them fail the moment you paste Devanagari, Chinese or an emoji. This one encodes the UTF-8 bytes, so any language round-trips unchanged.

Use the URL-safe alphabet when the result goes in a URL or a JWT: it swaps + and / for - and _ and drops the padding. Decoding accepts either alphabet, with or without padding, and strips a data: prefix if you paste a whole data URL.

Base64 is an encoding, not encryption. Anyone can decode it, so it hides nothing — it only makes bytes safe to carry through text-only channels like email headers and JSON.