IMAGE TO BASE64
Drop any image and get a Base64 data URI you can paste directly into HTML or CSS. Runs entirely in your browser — nothing is uploaded.
In short
Convert any image (JPG, PNG, WebP, GIF, SVG) to a Base64 data URI you can embed directly in HTML or CSS — entirely in your browser, no upload required.
Drop an image here or click to browse
JPG, PNG, WebP, GIF, SVG, AVIF and more
How to convert an image to Base64
- 1
Drop an image onto the upload area or click to browse for a file.
- 2
The tool instantly converts it to a Base64 data URI and shows a preview.
- 3
Copy the full data URI (with the data:image/… prefix) for use in an <img> src or CSS background-image.
- 4
Or copy just the Base64 string if you need to embed it manually.
Questions
- What is a Base64 data URI?
- A data URI is a URL scheme that embeds the file's raw bytes directly in the string, encoded as Base64 text. A browser can load it as an image without making a network request — useful for small icons, placeholders, and email templates.
- Is my image uploaded to a server?
- No. Everything happens locally in your browser using the FileReader API — the image bytes never leave your device.
- Should I use this for large images?
- Base64 encoding inflates file size by about 33 %, and embedding large images as data URIs makes your HTML or CSS much heavier. It is best suited for small icons, logos, or backgrounds under roughly 10 KB. For larger images, serve them as separate files.
- What image formats are supported?
- Any format your browser can open: JPG, PNG, WebP, GIF, SVG, AVIF, BMP, ICO, and others. The resulting data URI will include the correct MIME type (e.g. data:image/png;base64,…).
Related tools
- Base64 to Image ConverterPaste a Base64 data URI or raw Base64 string and preview and download the decoded image.
- AVIF to JPG ConverterConvert AVIF images to JPG, one at a time or as a batch, using your browser's own AVIF decoder.
- Image ConverterConvert between JPG, PNG, and WebP, one image or a whole batch at a time.
- Favicon GeneratorTurn one image into a full favicon set — 16x16, 32x32, 48x48, apple-touch-icon, and Android/PWA sizes — plus an HTML snippet and web manifest.
- HEIC to JPG ConverterConvert HEIC and HEIF photos from an iPhone into regular JPG images, one at a time or as a whole batch.
- SVG to PNG ConverterConvert an uploaded or pasted SVG into a PNG at any size, with a transparent or white background.
- Negative Film ScannerBacklight film on a screen light table, then invert and color-correct the photo into a positive.
- AI Background RemoverCut a person out of a photo's background using an on-device AI model, nothing uploaded.
Updated