Image to Base64 Converter
Convert an image to a Base64 data URI, with optional compression to shrink it first.
Processed 100% in your browser — nothing you enter here is ever uploaded.
Common use cases
Embedding a small icon or logo in CSS
Paste the data URI directly into a background-image: url(...) rule to skip an extra HTTP request for tiny images.
Inlining an image in JSON or an API response
Some APIs expect image data as a Base64 string rather than a separate file upload.
Shrinking a screenshot before sharing it as Base64
Large PNG screenshots often compress dramatically as JPEG or WebP with barely any visible quality loss.
How to use the Image to Base64
Drop in an image or click to browse for one.
Pick an output format — JPEG or WebP for the smallest files, or PNG to keep it lossless.
Choose a quality level (Low/Medium/High) and, if you want, a max width to shrink large images further.
Copy the Base64 data URI straight into your code, or download the compressed image file.