Turn an image into an embeddable Base64 string
Drop an image here, or click to browse
PNG, JPG, GIF, WebP, SVG
Upload your image
Drag and drop or browse for a file.
Pick an output format
Choose Data URI, plain Base64, HTML tag, or CSS.
Copy or download
Copy to clipboard or save as a text file.
Drop in an image and get back a Base64-encoded string, in whichever format you actually need: a full Data URI ready to drop straight into a src or url(), plain Base64 for building your own wrapper, a ready-to-paste HTML <img> tag, a CSS background-image declaration, or JSON.
Supports PNG, JPG, GIF, WebP, and SVG — SVG encodes to a data:image/svg+xml;base64,... URI, the standard way small logos, icons, and favicons get inlined to avoid an extra HTTP request.
Everything happens entirely in your browser — the image is never uploaded anywhere. Need to go the other way? Our Base64 to Image tool decodes a Base64 string back into a real, downloadable image file.
PNG, JPG, GIF, WebP, and SVG.
Yes, Base64 encoding has a fixed, unavoidable overhead: it represents every 3 bytes of the original file as 4 text characters, which works out to roughly 33% larger than the source — the tool shows you the exact increase for whichever output format you pick.
Base64 is useful for small icons or inline emails where avoiding an extra HTTP request matters, or when a format (like JSON or a CSS data URI) can't reference an external file. For anything larger than a few KB, a normal linked image file is almost always better — Base64 adds about 33% to the file size and can't be cached separately by the browser.
Data URI (the full data:image/...;base64,... string, ready to use directly as an <img> src or CSS url()), Plain Base64 (just the encoded data, no prefix, for when you're building your own wrapper), a ready-to-paste HTML <img> tag, a CSS background-image declaration, or JSON — pick whichever matches where you're actually going to use it.
Data URI is the complete string — data:image/png;base64,iVBORw0... — that browsers and CSS understand directly as an image source. Plain Base64 strips that prefix and gives you just the raw encoded characters, which is what you want if your own code or API is going to construct the data URI (or an equivalent wrapper) itself.
Yes — SVG is encoded the same way as the raster formats, producing a data:image/svg+xml;base64,... URI. That said, if you're only targeting modern browsers and specifically embedding SVG in CSS, a URL-encoded (percent-encoded) SVG is technically a little smaller than Base64 — Base64 is used here because it's universally supported and is what most build tooling and frameworks emit by default.
No artificial limit is enforced by this tool. Modern browsers support very large data URIs — Chromium and Firefox cap them at 512MB, Safari at 2048MB — far beyond what any real image needs. In practice, keep embedded images small (well under a megabyte) anyway: a large Base64 string bloats your HTML/CSS/JSON and can't be cached separately by the browser, regardless of what the hard technical limit is.
In JavaScript (browser), the same approach this tool uses: a FileReader with readAsDataURL(file) gives you the full data URI directly in reader.result — no manual byte manipulation needed. In Python: base64.b64encode(open("file.png", "rb").read()).decode() returns the plain Base64 string. In Node.js, it's fs.readFileSync(path).toString('base64').
No — encoding happens entirely in your browser. Nothing you drop in is sent to a server.
Yes — our Base64 to Image tool does the reverse direction, including SVG, and also handles the URL-safe Base64 variant that some APIs use.
Yes — that's a common, legitimate use case: many email clients block external images by default, so a Base64-encoded image embedded directly in the HTML shows up immediately without needing the recipient to allow images to load. Just be mindful of the ~33% size overhead, since email clients often have their own message size limits.
Not with this one — it's scoped to image formats (PNG, JPG, GIF, WebP, SVG). Our PDF to Base64 tool covers PDFs specifically, with the same kind of multi-format output.
Not directly — this tool works with a file you drop in or browse for. If your image is already hosted somewhere, download it first, or fetch it and convert it yourself with a couple of lines of code (fetch the URL, read the response as a blob, then follow the same FileReader approach described above).
Paste a Base64 string or data URI and get back a real, previewable, downloadable PDF file. Free, works entirely in your browser.
Convert a PDF file to a Base64 string, ready to embed in HTML, CSS, JSON, or an API payload. Free, works entirely in your browser.
Decode Base64 encoded strings back to image files instantly. Perfect for developers working with Base64 image data in web applications, APIs, or databases. Supports all common image formats including PNG, JPG, GIF, WebP, and BMP. Features include pasting Base64 strings (with or without data URI prefix), automatic format detection, live image preview with dimensions and file size, one-click download of decoded images, and format information display. Handles both raw Base64 strings and complete data URI format (data:image/png;base64,...). Useful for debugging API responses with Base64 images, converting database-stored Base64 images, testing Base64 image data, extracting images from JSON/API responses, and validating Base64 encoded images. 100% client-side processing ensures complete privacy - all decoding happens in your browser, data never leaves your device. No file size limits.
Format, validate, and beautify JSON data instantly. Minify JSON, fix formatting errors, and validate JSON syntax online. Perfect for developers working with APIs and configuration files.