Home โบ Image Tools โบ Image to Base64
๐ก Image to Base64
Turn an image into a Base64 data URL for CSS, HTML or JSON. Copy the full string or just the raw Base64 part.
About this Image to Base64
The Image to Base64 tool encodes a picture as a text string that can be embedded directly in HTML, CSS or JSON. Small icons and logos are often inlined this way so a page needs no extra image request. The encoding runs in your browser; the image itself is never sent anywhere.
How to use it
- Choose an image from your device.
- Wait a moment while it is encoded as a data URL.
- Click Select All to highlight the full string.
- Copy it and paste it into your code or document.
Example
A 12 KB PNG icon becomes a data URL you can paste into a CSS background-image, so the icon loads with the stylesheet.
Frequently asked questions
How much bigger is Base64 than the file?
About 33% larger than the original binary file, because every 3 bytes become 4 text characters.
When should I use Base64 images?
For small images like icons and logos. Large photos are better kept as normal files because the text gets huge.
Is the encoding reversible?
Yes, Base64 is an encoding, not compression or encryption. Anyone can decode it back to the original image.
More Image Tools
Image Compressor
Reduce JPG, PNG and WebP file size in your browser with a quality slider. No uploads, files stay on your device.
Image Resizer
Resize any image to exact pixel dimensions or a percentage, with an aspect-ratio lock. Free and fully in-browser.
Image Crop
Center-crop an image to a standard aspect ratio: 1:1, 4:3, 3:2, 16:9 or 3:4. Instant, free, nothing uploaded.
Image Rotate & Flip
Rotate an image left or right by 90 degrees, or flip it horizontally or vertically. Fixes sideways phone photos fast.
Image Format Converter
Convert images between JPG, PNG and WebP in your browser. Control quality for JPG and WebP output. Free, no upload.
Passport Photo Maker
Make a 35x45 mm passport-size photo (413x531 px) plus a printable 4x6 inch sheet of copies from any portrait photo.