Convert an image to Base64
Add an image and copy it as a data URL, bare Base64, a CSS background line or an HTML image tag. The panel shows how much longer the text is than the file.
Drop an image here
or browse your files
PNG, JPG, GIF, WebP, AVIF, SVG, ICO or BMP.
Add an image to get it as a data URL, bare Base64, a CSS background or an HTML image tag.
Nothing is uploaded. The text is made on your device.
- No ads
- No sign-up
- No watermark
- No daily limit
- Nothing uploaded
Several steps, or a whole batch? Chain this with other tools in a Workflow and run them in one go.
The size it adds
Base64 writes every 3 bytes as 4 characters, so the text is about a third longer than the file, plus the few characters of the data: prefix. That’s a fair trade for a small icon inside a stylesheet or an email. For photos, link the file instead.
Which version to copy
Data URL is the whole thing, ready for an src or url(). Base64 only is the bare text, for JSON and APIs that ask for it. CSS and HTML give you a line to paste, with the width and height filled in for the image tag.
Your files stay with you
Everything happens on your own device. Nothing is uploaded, nothing is stored, and you don’t need an account. Close the tab and it’s gone.
More image tools
- Compress imagesMake JPG, PNG and WebP files smaller, many at once.
- Compress to a file sizeGet every image under 50 KB, 100 KB, 1 MB or any limit.
- Resize imagesScale a batch down to a set width or height.
- Resize to exact sizeMake every image exactly 1920 × 1080, 1080 × 1080 or your own size.
- JPG to PNGTurn JPG photos into PNG files.
- PNG to JPGTurn PNG images into smaller JPG files.
- WebP to JPGOpen WebP downloads anywhere as JPG.
- WebP to PNGConvert WebP and keep transparency.
- JPG to WebPSmaller files for websites.
- PNG to WebPShrink PNGs and keep transparency.
- AVIF to JPGOpen AVIF images in any app.
- AVIF to PNGConvert AVIF and keep transparency.
- GIF to WebPAnimated GIFs as much smaller WebP files.
- WebP to GIFAnimated WebP for apps that only take GIF.
- Image under 1 MBPhotos under 1 MB, usually without losing a pixel.
- Image under 500 KBFit photos under 500 KB at the best quality that fits.
- Image under 200 KBPhotos and screenshots under 200 KB for forms and profiles.
- Image under 20 KBTiny files for strict forms: about 600 pixels for a photo.
- HEIC to JPGOpen iPhone photos on any computer.
- HEIC to PNGEvery pixel of an iPhone photo, in PNG.
- HEIF to JPGOpen .heif and camera .hif photos anywhere.
- HEIF to PNGHEIF photos as PNG, for editors that can’t read them.
- Image to text (OCR)Copy the words out of screenshots, photos, receipts and scans.
- SVG to PNGSharp PNG copies of SVG logos and icons at 1×, 2×, 4× or any width.
- SVG to JPGJPG copies of SVG files on the background colour you choose.
- Favicon generatorfavicon.ico, the Apple icon and app icons from one logo, plus the tags.
- ICO to PNGEvery size inside an ICO file saved as its own PNG.
- PNG to ICOTurn PNG, SVG or JPG images into ICO files with the sizes you tick.
- Colour picker from imageClick any pixel in a photo or screenshot for its HEX, RGB and HSL.
- Colour palette from imageThe main colours of a picture, with their share, as CSS variables.
- Base64 to imagePaste a data URL or Base64 text and download the image.
- Compress GIFMake an animated GIF smaller and keep it moving.
- GIF makerTurn photos or screenshots into an animated GIF.
- Video to GIFCut a short clip from a video and save it as a GIF.