Base64 Encoder / Decoder
Encode or decode Base64 instantly — text, URLs, or files.
100% in-browser — data never leaves your deviceDrop a file here or click to encode it to Base64
Any file type · or just paste text below
Data URI
Ready to paste into HTML or CSS as an embedded resource
Share this free tool
Find this tool useful? Help keep it free and ad-light!
Every coffee helps pay for hosting & development!
Common Base64 Use Cases
Embed images in CSS / HTML
Encode an image file and use it as a data: URI in <img src=""> or CSS background-image. Eliminates an HTTP request for small images.
JSON API payloads
Binary data (images, PDFs, audio) can't be sent directly in JSON. Base64 encode it first, send as a string field, decode on the other end.
Email attachments (MIME)
Email attachments are Base64-encoded inside the MIME message body. Most email libraries handle this automatically.
Basic Auth headers
HTTP Basic Authentication encodes credentials as Base64: btoa("username:password"). Not encryption — just encoding for transport.