Instantly encode text or files to Base64, or decode Base64 strings back to plain text. Supports standard and URL-safe Base64. Everything runs 100% in your browser — nothing is sent to any server.
Plain Text Input0 chars
Base64 Output0 chars
Enter text to begin encoding or decoding.
Format:
Line wrap:
📁
Drop a file to encode it
or browse files — any format supported (images, PDFs, docs…)
📊 Encoding Stats
0
Input bytes
0
Output chars
—
Size ratio
0
Padding (=)
⚡ Quick Examples
HelloSGVsbG8=
Hello WorldSGVsbG8gV29ybGQ=
1 + 1 = 2MSArIDEgPSAy
{"key":"val"}eyJrZXkiOiJ2YWwifQ==
💡 How it works
1️⃣
Paste or type your text in the input panel, or drop a file.
2️⃣
Instant result appears in the output panel as you type.
Base64 is a binary-to-text encoding scheme that converts arbitrary binary data into a string of 64 printable ASCII characters: A–Z, a–z, 0–9, +, and / (with = used for padding). It was designed to safely transport binary data — like images or files — through systems that only support plain text, such as email (MIME) or JSON APIs.
Every 3 bytes of input are converted into 4 Base64 characters, which means encoded output is always approximately 33% larger than the original input. Decoding reverses this process exactly, recovering the original bytes without any loss.
Common Use Cases
📧
Email Attachments (MIME)
Email protocols are text-only. Base64 encodes binary attachments like images and PDFs so they can travel safely through mail servers.
🌐
Data URIs in HTML/CSS
Embed images or fonts directly into HTML or CSS files as data:image/png;base64,… to eliminate extra HTTP requests.
🔑
JWT Tokens
JSON Web Tokens use URL-safe Base64 to encode their header and payload so they can be safely passed in URLs and HTTP headers.
🔌
API & JSON Payloads
APIs that exchange JSON often Base64-encode binary blobs — like file uploads or cryptographic keys — to keep payloads as valid JSON strings.
Standard vs URL-Safe Base64
Standard Base64 uses + and / as its 62nd and 63rd characters. These are special characters in URLs, so URL-safe Base64 replaces them with - and _ respectively. The padding character = is also sometimes omitted in URL-safe variants. Use URL-safe when encoding data for JWTs, OAuth tokens, or anything embedded in a URL query string.
Frequently Asked Questions
No. Base64 is purely an encoding scheme — it is completely reversible by anyone and provides zero security or confidentiality. Do not use it to hide sensitive data. If you need to protect data, use proper encryption like AES-256.
Base64 encodes 3 input bytes into 4 output characters. If the input isn't a multiple of 3 bytes, padding characters (=) are added to make the output length a multiple of 4. One = means 1 byte of padding; == means 2 bytes of padding.
Yes — use the file drop zone below the text panels. The file is read locally using the FileReader API and encoded entirely in your browser. No file data is ever uploaded to a server. The resulting Base64 string can be used as a data URI directly in HTML or CSS.
Base64 encoded data is always exactly 4/3 the size of the input — approximately 33% larger. For example, a 300 KB image encodes to roughly 400 KB of Base64 text. This is worth considering when embedding large files as data URIs.
Yes. The tool first converts your input to UTF-8 bytes (handling multi-byte characters and emoji correctly), then encodes those bytes to Base64. Decoding reverses this — from Base64 back to UTF-8 bytes, then to the original Unicode string.