Encoding converters
Image to Base64
Convert images to Base64 online: drop a PNG, JPEG, WebP, GIF, AVIF, SVG or ICO and get raw Base64, plus pixel dimensions, exact size and a data URI you can paste straight into HTML or CSS. 100% private — no uploads, no size limits.
Drop a PNG, JPG, WebP, GIF, AVIF, ICO or SVG and get its Base64 — plus pixel dimensions, exact size, a live preview and a data URI you can paste straight into HTML or CSS. The MIME type in the data URI is verified from the file's magic bytes, so even a misnamed file produces a correct embed. Unlike the server-based converters, nothing is uploaded: your image never leaves the browser.
Drop a file here
Any file works — images, PDFs, audio, video, archives. It is read locally in your browser and encoded to Base64 instantly; nothing is uploaded.
How to use
Image to Base64, step by step
- 01
Drop a picture onto the box (or click to choose one) — PNG, JPEG, WebP, GIF, AVIF, ICO and SVG all work. The file is read locally with the File API; nothing is uploaded anywhere.
- 02
Read the result card: pixel dimensions, exact byte size, detected MIME type and the Base64 character count — then copy the raw Base64, the data URI, or the first bytes in hex.
- 03
Use the data URI when you want a paste-ready embed for <img src>, CSS background-image or email HTML; use the raw Base64 when the target already knows the type (APIs, JSON payloads, databases).
FAQ
Frequently asked questions
Every file your browser can read is fair game — PNG, JPEG, WebP, GIF (including animated), AVIF, ICO, and SVG as a text file. For formats the browser does not recognise, the tool falls back to the file's own MIME type (application/octet-stream only when it truly has no better guess), so the data URI stays usable.
No server means no server-side cap — only your device's memory. The Base64 string is about 33% larger than the file (3 bytes become 4 characters), so a 4 MB photo yields roughly a 5.3 MB string; on a modern browser that is still comfortable.
Copy the data URI from this page and paste it directly: <img src="data:image/png;base64,…"> inline images, or background-image: url("data:image/png;base64,") in CSS. The Base64 to Data URL tool can also reformat the output as a ready-made tag or rule.
It probably never does — the type is verified from the actual bytes (magic numbers), not from the file extension or the operating system guess. A file renamed .png.jpg is still detected as PNG; that is the point of sniffing rather than trusting names.
Never. Unlike the popular server-based converters, this page has no upload endpoint at all. The read happens with FileReader in your own tab — check the network monitor and you will see zero requests while converting.
Related tools