Base64 Encoder — Encode Text, Images & Files Online
Text · Image · File — URL-safe mode · auto-detect · live image preview — 100% browser-side
Paste text → get Base64
Real-time · No button click · 200ms debounce
Convert any text, image, or file to Base64 instantly — no button click, real-time encoding. Toggle URL-safe mode for JWT tokens and URL parameters. Download or copy the result. Your data never leaves your browser — 100% private, 100% free.
What is Base64 Encoding?
Base64 encoding converts binary data into a string of 64 safe ASCII characters — A–Z, a–z, 0–9, +, and /. It is the standard way to embed binary content (images, files, certificates) inside JSON, XML, HTML, and email without breaking the format. The encoded output is ~33% larger than the original.
Standard vs URL-Safe Base64
Standard Base64 uses + and / which have special meaning in URLs. URL-safe Base64 (Base64URL) replaces +→- and /→_ and removes = padding. Use URL-safe mode for JWT tokens, OAuth tokens, and URL query parameters.
Frequently Asked Questions
How do I encode a file to Base64?
Switch to the File tab, upload any file up to 5 MB — PDF, ZIP, JSON, TXT, or any other type. The tool reads the file and outputs the full Base64 string. Copy it for API payloads, database storage, or email attachments.
What does URL-safe Base64 encoding mean?
URL-safe mode replaces + with - and / with _ and removes = padding. The result can be safely used in URLs, query parameters, JWT tokens, and filenames without any escaping needed.
Why does Base64 output end with == or =?
Base64 encodes 3 bytes into 4 characters. If the input length is not a multiple of 3, padding characters (=) are added. Two = means the input had 1 byte remainder; one = means 2 bytes remainder. URL-safe mode removes this padding.
Is there a file size limit for Base64 encoding?
This tool supports files up to 5 MB. Base64-encoding a 5 MB file produces ~6.7 MB of output. For larger files, encode them on your backend — browsers may struggle with very large Base64 strings in memory.
Can I use Base64 encoded images directly in HTML?
Yes — use the data URI format: <img src="data:image/png;base64,BASE64_HERE">. This embeds the image directly in your HTML without an HTTP request. Good for small images, icons, and offline apps.