Convert an image to Base64
The file as a data URL, ready to paste. Copy the raw string, an img tag or a CSS background rule.
How to convert an image to base64
- Drop an image in the zone above. The original file is encoded as is, byte for byte.
- Copy the raw data URL, the img tag or the CSS rule.
- Mind the size. Base64 adds about a third, so it is for small images.
When Base64 makes sense
Inlining spares a network request, which is worth it for tiny icons, tracking-free email signatures and single-file HTML documents. The encoded string is about 33 percent larger than the file, so it stops making sense quickly as images grow.
The file is encoded exactly as it is, with no re-compression, so what you inline is byte for byte what you dropped.
Like everything on this site, the tool runs entirely in your browser. Your image is never uploaded, and the server only serves this page.
More tools
- Compress an image to a target size
- Generate favicons
- Crop an image
- Combine images into one
- Resize an image
- Rotate or flip an image
- Blur part of an image
- Redact an image
- Adjust brightness, contrast and saturation
- Make a background transparent
- View and remove EXIF data
- Watermark an image
- Round image corners or crop a circle
- Split an image into a grid
- Sharpen an image
- Pick colours from an image
- Bulk resize images
- Convert images to a PDF
- Convert a PDF to images