Base64 Encoder & Decoder
Convert UTF-8 text or local files to standard Base64 or Base64URL, and decode either format back to readable text or downloadable bytes. The tool checks invalid characters, padding, and unused bits, and processes data locally in your browser.
How to encode text or files to Base64
Select Encode and choose Standard Base64 or Base64URL from Format. Type or paste text into Input text, then select Encode to Base64. The tool converts the text to UTF-8 bytes before encoding it.
To encode a file instead, select Open file beside the input heading and choose a file up to 2 MB. The file's bytes are encoded without interpreting them as text. Copy the resulting string or download it as a file.
Decode Base64 into text or a file
Select Decode, choose the matching Base64 format, and paste the encoded string. Decode Base64 converts the data back to bytes. When those bytes contain valid UTF-8, the decoded text appears in the result field.
If the bytes are not valid UTF-8, the result shows a binary-data summary rather than unreadable characters. Select Download to save those bytes to a file. Decode does not infer the original file type or extension.
Standard Base64 vs. Base64URL
The two formats represent the same bytes with slightly different character alphabets. Standard Base64 uses and ; Base64URL uses and , which are easier to include in URL components. This tool pads standard encoded results with when necessary and omits padding in Base64URL results.
The decoder accepts correctly padded or unpadded strings in either mode, but does not silently mix their alphabets. Select the format that matches the data you are working with.
Base64 and Base64URL compared
Both encodings can represent the same binary content. Select the correct alphabet for the destination format.
Swipe horizontally to view the full table.
UTF-8 text and binary bytes are different
Base64 represents bytes, not characters. When encoding text, UTF-8 turns characters into bytes first. For example, the word contains a non-ASCII character, so its Base64 output differs from an encoding based on a different character set.
When decoding, the bytes may represent text, an image, an archive, or another file format. A failed UTF-8 check does not necessarily mean the Base64 is invalid; it may simply contain binary data.
Why Base64 decoding can fail
The decoder rejects characters outside the chosen alphabet, invalid padding placement, impossible input lengths, and nonzero unused bits in the last Base64 character. These checks prevent malformed strings from being silently accepted as another representation of the same bytes.
Spaces, tabs, and line breaks may be included in pasted Base64 input. Other unexpected characters are not ignored. If decoding fails, check whether the string was truncated, copied with extra punctuation, or encoded using the other alphabet.
Copying and downloading the result
After conversion, the Copy icon copies textual results. Download saves encoded Base64 as a text file, decoded UTF-8 as a text file, or non-text decoded bytes as a binary file.
The tool does not add or remove bytes from successfully decoded binary output. Text and files are handled in the browser; copied text is transferred to your system clipboard and downloads are managed by your browser.
Base64 is encoding, not encryption
Base64 makes data easy to represent with printable characters. It does not require a key, hide its contents, or prevent anyone from decoding it. Encoding also generally increases the size of the data rather than compressing it.
Do not treat Base64 strings as protected secrets. In particular, placing encoded confidential data in a URL can expose it through browser history, logs, or sharing.
Examples
Encode ordinary text
1Input
Encode · Standard Base64 · Hello
Show result
Result
SGVsbG8=
The equals sign is standard Base64 padding.
Decode UTF-8 text
2Input
Decode · Standard Base64 · Q2Fmw6k=
Show result
Result
Café
The accented character is reconstructed from its UTF-8 bytes.
Encode with Base64URL
3Input
Encode file bytes FB FF FF · Base64URL
Show result
Result
-___
The standard Base64 representation of these bytes is +///.
Decode binary data
4Input
Decode · Standard Base64 · //79
Show result
Result
Binary data · 3 bytes
The decoded bytes are FF FE FD, not valid UTF-8. Download saves the original bytes.
Frequently Asked Questions
How do I decode Base64 to plain text?
Select Decode, paste the encoded string, and choose Decode Base64. If the result contains valid UTF-8, the text appears below the button.
Can I encode an image, PDF, or other file?
Yes. In Encode mode, select Open file and choose a local file up to 2 MB. The tool encodes its raw bytes and produces a Base64 string.
Can I decode Base64 back to a file?
Yes. Download saves decoded bytes. Binary output uses a generic .bin filename because the original file type and filename cannot be reliably determined from Base64 alone.
What is the difference between Base64 and Base64URL?
Base64URL replaces + with - and / with _. This tool also omits = padding when producing Base64URL, but accepts valid padded or unpadded input in either mode.
Does the decoder accept Base64 without padding?
Yes. Properly formed unpadded Base64 and Base64URL are accepted, as are correctly padded strings. Invalid padding and unused trailing bits are rejected.
Why did Base64 decoding produce binary data?
The Base64 decoded successfully, but the bytes are not valid UTF-8 text. Download the bytes if they belong to a file or another binary format.
Can I decode Base64 containing line breaks?
Yes. The decoder ignores ASCII spaces, tabs, and line breaks. Other characters outside the selected Base64 alphabet cause an error.
Is Base64 encryption or a way to protect passwords?
No. Base64 can be decoded without a key. It should not be used in place of encryption or secure password storage.
Is my data uploaded to Olivez?
No. The input and any selected file are processed in your browser. Copying sends text to your clipboard, and downloading saves a file through your browser.