Base64 Encoder & Decoder
Encode text or a file to Base64 and decode Base64 back to text, in the standard or the URL-safe (base64url) alphabet. Text goes through UTF-8, so accents and emoji survive the round trip. Drop a file to get its Base64 or a data: URI, and download decoded Base64 as a file. Everything runs in your browser.
Frequently asked questions
How do I encode text to Base64?
Paste the text into the input box with Encode selected and the Base64 appears immediately. Switch to Decode and paste a Base64 string to get the original text back — switching keeps what you typed and converts it the other way. Swap moves the output back to the input so you can check a round trip.
Can I Base64-encode a file or make a data URI?
Yes. Press Open file or drop a file onto the input with Encode selected and its Base64 appears in the output. Tick "Output as data: URL" to get the full data:<type>;base64,… form that goes straight into an <img src>, a CSS url() or a JSON field. In Decode mode a data: URL prefix is stripped automatically, and Download as file writes the decoded bytes out as a file — the way to recover an image or PDF from a Base64 string.
Is Base64 encryption?
No, and treating it as such is a real security mistake. Base64 is a reversible encoding with no key involved — anyone can decode it in seconds, as this page demonstrates. It exists to carry binary data through channels that only accept text, such as a JSON field, a data URI or an email attachment, not to hide anything.
Why does my Base64 string end in one or two equals signs?
Base64 encodes three bytes into four characters, so when the input length is not a multiple of three the last group is padded out with = to keep the length a multiple of four. One byte left over gives two equals signs, two bytes give one, and an exact multiple gives none.
What is URL-safe Base64 and when do I need it?
Standard Base64 uses + and /, which both have meanings inside a URL, and = which has to be escaped in a query string. URL-safe Base64 (base64url, RFC 4648 §5) swaps them for - and _ and drops the padding. Pick it here when the value goes into a path, a query parameter or a JWT. Decoding accepts either alphabet automatically, so you do not have to know which one you were handed.
What does "Wrap output at 76 characters" do?
MIME (RFC 2045) requires Base64 in email bodies to be broken into lines of at most 76 characters, and some tools such as openssl base64 and PEM files wrap at 64 or 76 by default. The checkbox writes the output in 76-character lines for those destinations. It changes only the layout, not the data: decoding here ignores line breaks and whitespace, so wrapped and unwrapped input decode to the same bytes.
Does it handle accented characters and emoji correctly?
Yes. The text is encoded as UTF-8 before being Base64-encoded, and decoded back through UTF-8, so accents, CJK characters and emoji survive a round trip intact. The raw btoa function in a browser throws on anything outside Latin-1, which is why hand-rolled Base64 often breaks on the first emoji. If the decoded bytes are not valid UTF-8 the tool says so instead of printing replacement characters — that usually means the Base64 is a file, which Download as file will give you.
Why does my Base64 fail to decode?
Usually because something was lost in transit: a line break in the middle of the string, a URL that percent-encoded the + signs into spaces, or a truncated copy. Whitespace, missing padding and either alphabet are handled for you here, so the tool reports two real problems: a character outside the Base64 alphabet, or a length that no byte sequence could produce, which means the string was truncated.
Is my data uploaded to a server?
No. The whole tool is JavaScript running in your own browser, so nothing you type, paste or open as a file is sent over the network, written to a log or attached to an analytics event. You can confirm it by opening the network tab and watching it stay empty while you work.
