Base64 Encode / Decode
Encode text or files to Base64 and decode them back — including back to a file.
About the Base64 Encode / Decode
Base64 represents binary or text data using 64 safe ASCII characters — used in data URLs, email (MIME), API tokens, JWTs, and config files. This tool encodes text and files to Base64 (or a ready-to-use data URL) and decodes Base64 back — either to text, or downloaded as the original file — with full Unicode support.
It matches what desktop tools offer: pick the character set (UTF-8, UTF-16, Latin-1), choose the newline separator, encode each line separately, wrap output into 76-column MIME chunks, or switch to URL-safe Base64URL. Drop in an image to get a data URL you can paste straight into HTML or CSS. Everything runs in your browser — nothing is uploaded.
How to use it
- 1Pick a mode. Choose Text → Base64, Base64 → Text, File → Base64, or Base64 → File.
- 2Set options. Optionally choose a character set, URL-safe, MIME wrapping, or per-line encoding.
- 3Copy the result. The output updates instantly — click Copy.
Frequently asked questions
How do I convert an image to Base64?+
Open the File → Base64 tab and choose an image. You get a data URL (data:image/…;base64,…) you can paste directly into an <img src> or CSS url(), or switch the output to raw Base64.
How do I turn Base64 back into a file?+
Use the Base64 → File tab. Paste a data URL or raw Base64 and it decodes to the original bytes and gives you a Download button. Data URLs set the file type and extension automatically (e.g. a data:application/pdf becomes a .pdf); for raw Base64 you can set the filename yourself.
What is URL-safe Base64 (Base64URL)?+
A variant that replaces + and / with - and _ and drops the = padding, so the string is safe inside URLs and filenames. Tick “URL-safe encoding” to produce it; decoding accepts it automatically.
What does the 76-character option do?+
It wraps the Base64 output into 76-column lines, the format required by MIME (email). Leave it off for a single continuous string.
Does this handle non-English characters?+
Yes. With UTF-8 (the default), emojis and non-Latin scripts round-trip correctly. UTF-16 and Latin-1 are available for legacy data.
Is Base64 encryption?+
No. Base64 is encoding, not encryption — anyone can decode it. Never use it to protect secrets; use real encryption for that.
Related tools
Encrypt Text
Encrypt a message with a passphrase and share it as a link — plus SHA hashes.
JSON Formatter
Format, validate, explore, and minify JSON.
QR Code Generator
Create a QR code from a link, Wi-Fi, contact, email, or SMS.
Character Counter
Count characters, words, sentences, and reading time live.
Online Notepad
A private notepad that saves in your browser.
Regex Tester
Test and debug regular expressions with live match highlighting.
More free tools
Image Resizer
Resize any image by pixels or percentage, in your browser.
Merge PDF
Combine multiple PDF files into one, in order.
Unit Converter
Convert length, weight, temperature, and more.
Password Generator
Create strong, random passwords instantly.
Character Counter
Count characters, words, sentences, and reading time live.
Percentage Calculator
Work out percentages, ratios, and percent changes.