Base64 Encode and Decode
Encode text to Base64 or decode it back in your browser, with full UTF-8 support. Free, instant and nothing is uploaded.
Paste or type, or drop a file on the box.
Runs in your browser. Nothing you enter is uploaded or stored.
How to use the Base64 Encode and Decode
- Choose Encode to turn text into Base64, or Decode to turn Base64 back into text.
- Type or paste into the left box. The result appears on the right as you type.
- When encoding for a URL, file name or token, tick URL-safe output.
- Press Swap to move the result into the input and reverse the direction, which is a quick way to check a round trip.
- Copy the result or download it as a text file.
Questions and answers
- Is my text sent to a server?
- No. Encoding and decoding run entirely in your browser. Nothing you type or paste is uploaded, stored or logged.
- Is Base64 a form of encryption?
- No. Base64 is an encoding, not encryption: anyone can decode it without a key. It exists to carry data safely through systems that only handle plain text, such as email, JSON and URLs. Do not use it to hide passwords or secrets.
- Does it handle accents, non-Latin scripts and emoji?
- Yes. Text is converted to UTF-8 bytes before encoding and read as UTF-8 after decoding, so characters such as é, ع, 中 and emoji come back exactly as they went in.
- What does URL-safe output change?
- Standard Base64 uses + and /, and pads the end with =. All three have a special meaning in URLs. The URL-safe form, also called base64url, uses - and _ instead and leaves the padding off. JSON Web Tokens use this form. When decoding, both forms are accepted automatically.
- Why does my Base64 fail to decode?
- Either it contains a character outside the Base64 alphabet, it was cut short so its length no longer fits, or it decodes to something that is not text, such as an image or a compressed file. Spaces, line breaks and a leading data: prefix are ignored, so those are not the cause.
- Why is the encoded result longer than my text?
- Base64 writes every 3 bytes as 4 characters, so the output is about a third larger than the input. Characters outside basic Latin take 2 to 4 bytes each in UTF-8, which adds to the length.
Related tools
File to Base64Convert an image or any file to a Base64 string or data URI, and turn Base64 back into a file. Runs in your browser.URL Encode and DecodePercent-encode text for use in a URL or decode an encoded URL back to readable text. Free and runs in your browser.HTML Entity Encode and DecodeEscape special characters to HTML entities or convert entities back to plain text. Free and runs in your browser.Unicode Escape and UnescapeConvert text to Unicode escape sequences and code points, or turn escaped sequences back into readable characters.Text to Hex and BinaryConvert text to hexadecimal, binary or ASCII codes and back again. Free, instant and runs entirely in your browser.