Base64 Encoder & Decoder
Turn text or a file into Base64, or Base64 back into text or a file. Your data stays on your device.
Add text or a file, choose the settings below, then press Encode.
Encoding settings
Add Base64 text, choose the settings below, then press Decode.
Decoding settings
How to encode and decode Base64
Choose Encode or Decode
Encode turns text or a file into Base64. Decode turns Base64 back into text or a file.
Add your input
Type, paste or import text, or choose a file to encode. Paste Base64 to decode.
Press the button
Check the result, then copy it or download it.
Encoding
- Text is encoded as UTF-8. Accents, emoji and other scripts are turned into UTF-8 bytes first, as most websites and APIs expect. Line breaks are encoded as the text box holds them (LF).
- Files. Choose one file of any type. Its bytes are encoded as they are; the file name is not part of the output.
- Standard or URL-safe. Standard Base64 uses + and /. Base64URL uses - and _ so the text can sit in a web address or a token. Choosing URL-safe switches the padding off, because most uses leave it out; you can turn it back on.
- Padding and line breaks. Padding adds = at the end so the length is a multiple of 4. Breaking lines every 76 characters gives the layout used in email (MIME), with LF line breaks.
Decoding
- Alphabet. Detect accepts either alphabet, but refuses text that mixes + / with - _. Choose Standard or URL-safe to be strict. Spaces and line breaks are ignored, and a data: URL prefix is removed.
- Padding. Missing = at the end is accepted and mentioned in the summary. Wrong padding, other characters and lengths that cannot be Base64 are refused, and the message says what is wrong.
- Text or file. As text, the bytes are shown only if they are valid UTF-8. Otherwise you get the file card instead, with the size, the kind of file when the first bytes show it (PNG, JPEG, GIF, WebP, PDF, ZIP or gzip), and a download with a file name you can change.
- Decoded files are not opened. The tool never shows, runs or previews a decoded file. It only gives it back to you as a download, so open it only if you trust where the Base64 came from.
Limits
- 5 MB
- 7 MB
Larger input is refused with a message rather than cut. Encoding and decoding run in a background thread (a Web Worker) so the page stays responsive. The output box shows the first 200,000 characters of a long result; Copy and Download always use all of it.
What happens to your data
Everything runs in your browser. Your text and files are not uploaded and are not sent to any server. They are not saved in the browser and not put in the page address. Refreshing or closing the tab discards them. See Privacy.
Not included
- Encryption: Base64 hides nothing
- Other encodings such as Base32 or hex
- Encoding several files at once
- Previews of decoded files
Frequently asked questions
Is Base64 encryption?
No. Anyone can decode it. It only writes bytes as plain characters, so do not use it to protect secrets.
Is my data uploaded?
No. It is encoded and decoded in your browser. The site only delivers the page and its code.
Why does the output end with =?
It is padding that makes the length a multiple of 4. You can switch it off when you encode.
Why is the Base64 about a third larger than the original?
Every 3 bytes become 4 characters, so the output is roughly 4/3 of the input size.
Do I need an account?
No. The tool is free and needs no sign-in.