Base64 Encode Decode Online Free

Encode text to Base64, decode Base64 to text, convert files to data URIs, and switch between standard Base64 and URL-safe Base64URL — all in your browser, nothing uploaded.

🔐 Base64 Encoder / Decoder
Live convert (auto-update as you type)
Text to Encode 0 characters
Standard Base64
Encoded Result
Result will appear here...
0 characters
📁 File to Base64 — Data URI Generator

Drop an image or file to generate its Base64 data URI — perfect for embedding in HTML, CSS, or JSON.

📤

Click to select or drag & drop a file here

Supports images (PNG, JPG, SVG, GIF, WebP) and any file up to 10MB

📎 File name:
📦 File size:
🔗 Data URI (first 200 chars):
📜 Recent Conversions
  • No conversions yet. Start encoding or decoding above.

Frequently Asked Questions

What is Base64 encoding used for?
Base64 encoding converts binary data into ASCII text, making it safe for text-only systems like email (MIME), JSON/XML data transport, and data URIs in HTML & CSS. It's also used in JWT tokens, API authentication headers, and storing binary data in databases that only support text.
How to decode Base64 to text?
Switch this tool to "Decode" mode (or "Auto Detect"), paste your Base64 string, and click Convert. The tool decodes it back to the original text. Common use: inspect JWT payloads, decode API responses, or read encoded configuration values.
What's the difference between Base64 and Base64URL?
Base64 uses +, /, and = padding. Base64URL replaces +-, /_, and strips = padding, making it safe for URLs and filenames. JWT (JSON Web Tokens) uses Base64URL. You can switch between both modes using the pills above the input.
How to encode an image to Base64?
Use the "File to Base64" section above. Drop your image (PNG, JPG, SVG, etc.) or click to select it. The tool generates a complete data URI that you can paste directly into <img src="data:image/png;base64,..."> or CSS background-image: url(). This reduces HTTP requests but increases page size — use it wisely for small icons.
Is Base64 the same as encryption?
No. Base64 is encoding, not encryption. Anyone can decode it instantly — there is no secret key. Never use Base64 to protect sensitive data like passwords or private keys. For security, use actual encryption (AES, RSA). Base64 is for compatibility, not confidentiality.
Why does Base64 output end with = or ==?
Base64 processes data in 3-byte chunks, producing 4 Base64 characters per chunk. When the input length isn't a multiple of 3, padding = characters are added to make the output a multiple of 4. One = means 1 byte of padding, == means 2 bytes. Base64URL mode strips these for cleaner URLs.
Is it safe to use online Base64 tools for sensitive data?
This tool runs entirely in your browser — zero data is sent to any server. Your text never leaves your computer. You can even save this page and use it fully offline. That said, avoid pasting passwords or API keys into any website you don't trust, and check the privacy policy of any tool you use.
✓ Copied!