Base64 Encoder & Decoder
Convert UTF-8 text or a file to standard Base64, or decode a pasted string into a download. Inspect valid UTF-8 before copying it.
- Choose direction
- Supply bytes
- Save the result
Convert Base64
- Choose direction
- Encode
- UTF-8
Choose direction
Select text, file or decoding mode before entering the source.
- Supply bytes
- Alphabet
- A to Z, a to z, 0 to 9, + and /
Supply bytes
Paste text, pick a file up to 8 MB, or paste standard Base64. Whitespace between encoded lines is ignored.
- Save the result
- Output
- TXT or binary
Save the result
Copy the string for a text field or download decoded bytes for a binary attachment.
Check an accented letter
The UTF-8 bytes for café produce Y2Fmw6k=. Decode that string and the accent returns intact. A different source encoding may produce bytes that cannot be displayed as UTF-8.
- café
- Y2Fmw6k=
Recover a binary file
Select file encoding to preserve the exact bytes of an attachment. After decoding, choose the original extension when saving the binary file. Base64 alone does not record its name or media type.
Use the JSON formatter when the decoded text contains JSON.
If the sender supplied a digest, check the decoded download with the file checksum verifier.
- Binary data
- Byte-for-byte download
Identify what was encoded
Text encoding
Accents, emoji and non-Latin characters can occupy several bytes apiece. The length of a JavaScript string is a poor guide to the length of its Base64 representation.
Standard alphabet
A token containing a hyphen or underscore may use Base64URL. This decoder expects the standard plus and slash alphabet. Check the producer’s format if decoding fails.
| Setting | Result |
|---|---|
| café | Y2Fmw6k= |
| Binary data | Byte-for-byte download |
Where are your records processed?
Encoding and decoding use this browser. Anyone with the encoded string can recover the bytes. Privacy policy.
- Choose direction
- Supply bytes
- Save the result
Base64 Encoder & Decoder questions
Is Base64 encryption?
No. It represents each group of three bytes with four text characters and offers no secrecy.
Can I paste a data URL?
Yes. A base64 data URL is accepted and its header is removed before decoding.
Why is the encoded file larger?
Four characters carry three bytes. The last group may also have padding.