Base64 Encode & Decode — Free Online Converter
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
One tool for all your Base64 needs — encode text to Base64 or decode Base64 back to text, switch direction with one click, encode images to data URIs, or convert any file. Auto-detect tells you if your input is already Base64 and offers to switch modes.
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 switch between encode and decode mode?
Use the Encode / Decode direction buttons at the top of the tool. The ⇅ swap button moves your current output into the input for a round-trip conversion. The auto-detect banner also prompts you to switch when it recognizes Base64 input.
Does Base64 encoding change the content of my data?
No — Base64 is a lossless encoding. Decoding always recovers the exact original content. The encoded string looks different but represents identical data. Use it to transport binary data through text channels safely.
What is a Base64 data URI?
A data URI is a URL that embeds file content directly: data:[mime];base64,[data]. Example: data:image/png;base64,iVBORw0K... — browsers render these directly as images, making them useful for inline HTML/CSS and API payloads.
Can I share my Base64 result with a link?
Yes — click the Share URL button. The tool encodes your input in the URL (up to 500 characters). Anyone with the link gets your exact input pre-loaded. Useful for sharing examples with teammates.
Why does my Base64 string have different lengths?
Base64 length depends on input size. The formula is: ceil(inputBytes / 3) × 4. A 3-byte input becomes 4 chars. A 100-byte input becomes 136 chars (33% overhead). URL-safe mode removes = padding so the string is slightly shorter.