Image to Base64 Converter
Encode images into Base64 strings for embedding in code, or decode Base64 back into a downloadable image. Get output as raw text, Data URI, CSS, or HTML.
Drag & drop an image, or browse
Any image format accepted
When to use Base64 encoding
Embed in CSS/HTML
Inline small icons or backgrounds without extra HTTP requests.
API payloads
Send images as text within JSON request bodies.
Email templates
Embed images directly in HTML emails.
Output formats explained
Raw Base64
For passing into custom code, database storage, or APIs that expect a bare encoded string.
Data URI
A complete data: URL you can paste directly into an <img src> or browser address bar.
CSS
A ready-to-paste background-image declaration for stylesheets.
HTML <img>
A full image tag you can drop directly into HTML markup.
Base64 encoding converts binary data into text using a 64-character alphabet, which inherently increases size by roughly 33% compared to the original binary file. This is the mathematical cost of representing binary data as text - it's not something any encoder can avoid. For large images, consider whether a regular file upload or URL reference would serve your use case better than inline Base64.
Frequently asked questions
5 questionsBase64 encoding increases file size by about 33% because it represents every 3 bytes of binary data as 4 text characters. This is expected and unavoidable - it's the tradeoff for representing binary data as plain text.