Image to Base64 Converter
Convert any image to a Base64 string or Data URL for use in CSS, HTML, emails, or APIs. Instant, free, and 100% private.
Drop your image here, or browse
Supports JPG, PNG, WebP, GIF, SVG, BMP, ICO
What is Base64 image encoding?
Base64 encoding converts binary data (like an image file) into a string of ASCII text characters. The result is a Data URL — a self-contained reference that includes the image's content directly in the URL. You can use it anywhere a regular image URL would work, without hosting the image file separately.
Common use cases: embedding images in HTML email templates (no external server required), using images as CSS background-image values, embedding icons directly in React/Vue component CSS-in-JS, or passing images to REST APIs that accept JSON payloads.
When to use Base64 and when not to
Good candidates for Base64: small icons and logos under 5–10 KB, images used in HTML emails, single-use SVG icons in JS components, images in environments without file hosting.
Avoid Base64 for: large images (photos, banners). Base64 encoding increases file size by approximately 33%, so a 100 KB photo becomes ~133 KB of text — plus it can't be cached separately by the browser.
Frequently asked questions
What image formats are supported?
Any format your browser can display: JPG, PNG, WebP, GIF, SVG, BMP, ICO, and AVIF. The resulting Data URL will use the original MIME type of the file.
How do I use the output in HTML?
Use the Data URL tab output as the src attribute: <img src="data:image/png;base64,...">
How do I use it in CSS?
Use the CSS tab output: background-image: url("data:image/png;base64,...");
Is there a file size limit?
No hard limit — the tool works entirely in your browser and handles any file size your RAM can accommodate. For practical use, keep source images under 1 MB.