Upload a file
  1. base64hub
  2. Image tools

Base64 Image Tools and Converters

Turn an image into a Base64 string or data URI for HTML, CSS, JSON or an API, or paste Base64 to preview and save the picture inside. Every converter works offline in the browser.

Free no sign-up, no limits Local nothing uploaded Updated Oct 27, 2026
IMGImage to Base64PNG, JPG, GIF, WebP, SVG to data URI IMGBase64 to imagePreview and download images SVGSVG to Base64Vector icons as data URIs for CSS PNGPNG to Base64Lossless images as data URIs JPGJPG to Base64Photos as Base64 strings PNGBase64 to PNGPreview and save PNG JPGBase64 to JPGPreview and save JPEG SVGBase64 to SVGSafe SVG preview and source SVGSVG data URIURL-encoded vs Base64, side by side GIFGIF to Base64Animated GIFs as data URIs GIFBase64 to GIFPreview animated GIFs WEBPWebP to Base64Small modern images as data URIs WEBPBase64 to WebPPreview and save WebP ICOFavicon to data URIInline favicons in HTML ICOBase64 to ICOPreview and save icons BMPBMP to Base64Bitmaps, optionally converted to PNG BMPBase64 to BMPPreview and save bitmaps AVIFAVIF to Base64Next-gen images as data URIs HEICHEIC to Base64iPhone photos as Base64 TIFFTIFF to Base64Scans and TIFF images as Base64

Which image tool do I need

Your taskTool
Any image to Base64 or a data URIImage to Base64
Paste Base64 and see the pictureBase64 to image
Logos, screenshots, transparencyPNG to Base64, Base64 to PNG
PhotosJPG to Base64, Base64 to JPG
Smaller files for the webWebP to Base64, AVIF to Base64, Base64 to WebP
AnimationsGIF to Base64, Base64 to GIF
Vector icons in CSSSVG to Base64, or the usually shorter SVG data URI
Inspect an SVG from Base64 safelyBase64 to SVG
An inline faviconFavicon to data URI, Base64 to ICO
iPhone photos, scans, legacy bitmapsHEIC to Base64, TIFF to Base64, BMP to Base64, Base64 to BMP

The encoders share one set of outputs: plain Base64, data URI, CSS background-image, HTML <img> with width and height, Markdown, and a JSON object with name, type and size. You can drop several files at once or paste a screenshot with Ctrl+V.

Choosing the format before you encode

Base64 makes every image a third larger, so the format decides most of the final length.

  • PNG for flat graphics, UI elements and anything with transparency or text.
  • JPEG for photos, where a PNG would be several times larger.
  • WebP for both cases when the target supports it; it is usually the smallest of the three.
  • SVG for icons and logos that are vector drawings. As a URL-encoded data URI it is often shorter than Base64, which the SVG data URI tool compares side by side.
  • HEIC and TIFF are encoded as they are. Most browsers cannot display them, so convert to JPEG or PNG first if the result has to show in a web page.

Recognizing image Base64

PrefixFormat
iVBORw0KGgoPNG
/9j/JPEG
R0lGODlh / R0lGODdhGIF
UklGRRIFF container: WebP, but also WAV audio
PHN2Zy / PD94bWwgSVG starting with <svg or <?xml
AAABAAICO
QkBMP

A full data URI adds the MIME type in front, as in data:image/png;base64,iVBORw0KGgo…. The decoders accept both forms, and also strings pasted together with the surrounding CSS or HTML. If the string turns out not to be an image, Base64 to file identifies other formats, and the file tools cover PDFs, audio, video and documents.

FAQ

How do I know which image format a Base64 string contains?

Look at the first characters: iVBORw0KGgo is PNG, /9j/ is JPEG, R0lGOD is GIF, UklGR is a RIFF container such as WebP, and PHN2Zy or PD94bWwg is usually SVG. Base64 to image detects the type for you.

Can I shrink an image before encoding it?

Yes. The PNG, JPG, WebP, GIF, BMP and AVIF converters, and the general image encoder, can resize to a maximum width, re-encode as PNG, JPEG or WebP with a quality slider and strip EXIF metadata, all in the browser.

Should small icons be inlined as Base64?

For a few small icons, inlining saves requests. Larger images are better as files: Base64 adds a third to the size and the data cannot be cached separately from the page. Data URI performance has the numbers.