Base64 encoder · Base64 decoder
Base64 Encode / Decode
Encode or decode Base64 text and files.
Text, Base64 or any file.
Free · No sign-up · UTF-8, URL-safe, MIME and PEM
- FileFiles tooAny file to Base64 and back.
- FixForgiving decodeStrips prefixes, spaces and quotes.
- AutoDirectionPicks Encode or Decode from what you paste.
Encoding, picked for you.
Options
Wrap lines
Encode only.
Result
/base64-encode-decode
How it works
Type, paste or open a file, then copy or download the result.
- 1
Type, paste or open
Text, Base64 or any file.
- 2
It picks the direction
Switch between Encode and Decode any time.
- 3
Set options
URL-safe and line wrap for encoding.
- 4
Copy or download
As text, or as a file when it is not text.
Frequently Asked Questions
Answers about Base64 Encode / Decode.
How do I encode text to Base64?
Type or paste your text into the box. The Base64 result updates as you type, and text is encoded as UTF-8 so accents and emoji work.
How does the tool know whether to encode or decode?
It switches to Decode when you paste valid Base64, a data URI or one long unbroken string. Short words stay on Encode, and you can switch modes by hand at any time.
Can I encode a file to Base64 or decode Base64 to a file?
Yes. Open a file or drop it on the box to encode it. When decoded Base64 is not text, such as an image, it downloads as a file.
What does Fixed for you mean?
When you decode, the tool removes a data URI prefix, whitespace and quotes, converts URL-safe characters and adds missing padding. The Fixed for you note lists each change.
Why does it say the result is not text?
The decoded bytes are not valid UTF-8, so they are most likely a file such as an image. The tool offers a download instead of showing broken characters.
What are the 76 and 64 line options?
They wrap the Base64 output into lines. 76 characters per line is the MIME format used in email, and 64 is the PEM format used for certificates and keys. None keeps the output on one line.
What is URL-safe Base64?
URL-safe Base64 uses minus and underscore in place of plus and slash, so the string works in links and file names. This tool also drops the equals sign padding at the end.