Base64 Encode and Decode Online (UTF-8 Safe)
Use this free tool to Base64 decode or encode text instantly. Paste Base64 to turn it back into readable text, or type text to encode it. It handles emoji and accented letters correctly (UTF-8), supports URL-safe Base64, and can turn a small file into a Base64 data URL.
File to Base64
Everything runs in your browser. Nothing you enter is sent to or stored on our server.
Quick answer: Paste Base64 into the right-hand box and the decoded text appears on the left. Type in the left box to encode. Both directions update as you type.
How to Base64 decode and encode
- Decode: paste the Base64 string into the Base64 box. Spaces and line breaks are ignored, missing padding (=) is added, and URL-safe characters are accepted automatically.
- Encode: type or paste text into the Text box.
- Tick URL-safe when the result goes into a web address, a JWT or a file name.
- To embed a small image in HTML or CSS, use File to Base64 and copy the data URL.
What is Base64?
Base64 turns any data into text made of 64 safe characters: A-Z, a-z, 0-9, + and /, with = for padding. Every 3 bytes become 4 characters, so encoded data is about 33% larger. It exists because many older systems, such as email, only handled plain text reliably. Base64 is encoding, not encryption: anyone can decode it, so never use it to hide passwords or secrets.
Where you see Base64
- Email attachments (MIME) are sent as Base64.
- Data URLs embed small images in web pages:
data:image/png;base64,… - JSON Web Tokens (JWT) use URL-safe Base64 for their header and payload. Paste the middle part of a token to read its claims.
- HTTP Basic authentication sends
username:passwordas Base64, which is why it must only be used over HTTPS. - APIs and config files often carry certificates and keys in Base64.
Why UTF-8 matters
The browser’s built-in btoa() function fails on characters outside basic Latin, such as é, ₹ or emoji. This tool first converts text to UTF-8 bytes, so any language encodes and decodes correctly. If decoded text shows � symbols, the Base64 probably holds binary data, such as an image or a zip file, rather than text.
Base64 in code
- Command line:
base64 file.txtto encode,base64 -dto decode (macOS:base64 -Don older versions). - Python:
base64.b64encode(b"text")andbase64.b64decode(s) - PowerShell:
[Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes("text"))
Working with web addresses? Use our URL encoder and decoder. For JSON data, try the JSON formatter.
FAQ
Is Base64 secure?
No. It is reversible by anyone. Use real encryption for sensitive data.
Why does my Base64 end with = or ==?
Padding makes the length a multiple of 4 when the input isn’t a multiple of 3 bytes.
Are my files uploaded?
No. Files are read and converted inside your browser.
More free tools
See all of them on the QuickOnlineTips free online tools page and play our free online games.
