Base64 encoder and decoder
Encode text or file bytes as Base64, or decode Base64 to UTF-8 text or a binary file.
- 1Add input
- 2Adjust settings
- 3Get your result
Tool input and files are processed in this browser without being uploaded.
Before you start
Convert UTF-8 text or a local file's bytes to standard Base64. You can also decode Base64 into text or download the decoded bytes as a binary file. Processing happens in your browser. Base64 does not encrypt the content.
How to use this tool
- Paste text or choose one local file. To decode, supply Base64 text; to encode a file, select the original file whose bytes you need.
- Under Options, choose Encode or Decode in Operation. For Decode, choose UTF-8 text or Binary file under Decoded output. Enable Ignore whitespace in Base64 only if spaces or line breaks should be removed before decoding.
- Select Convert Base64. Copy or download a text result, or download decoded.bin for binary output. Run the conversion again after changing the input or options.
Supported inputs and limits
Paste up to 1 MiB of text, measured in UTF-8 bytes, or choose one file up to 10 MiB.
Filenames can contain up to 512 UTF-16 code units; a visible character may use more than one code unit. For decoding, the file itself must contain Base64 saved as UTF-8 text.
A selected file takes priority over pasted text. Encoding uses the file's raw bytes. Remove the file to use the text box instead.
Text previews show up to 4,000 characters. Copy result and the result.txt download contain the complete text. For binary output, download decoded.bin to keep the complete decoded bytes.
Worked example
Example input
中文😀
Example options
{}Example output
5Lit5paH8J+YgA==
When something does not work
If a file cannot be read, select it again or remove it to use pasted text. Check the Base64 characters, padding and whitespace setting when decoding fails. Choose Binary file if the decoded bytes are not UTF-8 text. Editing the input marks the previous result as stale, and a failed run clears it. Copy or download any result you want to keep before refreshing or closing the tab.
Frequently asked questions
Why is my Base64 rejected?
Decoding expects the standard Base64 alphabet, including + and /, with correct = padding where needed and zero unused padding bits. It does not accept the Base64url alphabet or a data: URL prefix. Whitespace is rejected unless you enable Ignore whitespace in Base64. That option removes whitespace; it does not repair other invalid characters or padding.
Should I choose UTF-8 text or Binary file?
Choose UTF-8 text when the decoded bytes represent valid UTF-8. Choose Binary file for other data or when you need the exact decoded bytes. UTF-8 text decoding consumes an initial UTF-8 byte order mark, while binary output preserves it. Binary output is downloaded as decoded.bin; its Copy result button copies the byte-count summary, not the file's bytes.
Documentation & further reading
Related tools
URL encoder and decoder
Percent-encode or decode a URL component or whole URL, with optional plus-to-space decoding.
HTML entity encoder and decoder
Encode special HTML characters, or decode named and numeric references as plain text.
Unicode escape converter
Convert text to Unicode escapes or decode supported JavaScript-style escapes into readable text.
SHA-256 checksum
Calculate a SHA-256 checksum for text or a file.