How to Resize an Image Without Stretching or Distortion
Prevent stretched images by respecting aspect ratio and choosing explicitly between cropping, empty space, and a different frame.
Read guide →Encode an image as a Base64 string you can paste into CSS, JSON, or an HTML attribute, generated on your own device.
Drop image(s) here or click to browse
Editor & live preview appear below once you add an image.
Reviewed 2026-08-15
Base64 rewrites binary data using 64 printable characters, which lets an image travel inside a text format. That is how an icon ends up embedded in a stylesheet, a JSON payload, or an email template rather than being fetched as a separate file.
The output here is the raw Base64 string without a prefix. If you need a data URI ready to drop into a src or a background-image, use Image to Data URI instead, which returns the same payload with the data:image/png;base64, prefix already attached.
The encoding step grows the data by roughly a third, because three bytes of input become four characters of output. That overhead is the reason to keep this for small assets. Inlining a photograph bloats your HTML or CSS and, unlike a linked file, an inlined image cannot be cached separately by the browser.
For assets of a few kilobytes where saving a request matters more than caching, such as a small icon in CSS or a logo in an email. Anything larger is better served as a normal file.
Base64 is the encoded payload. A data URI is that payload with a scheme and MIME type in front, like data:image/png;base64,iVBORw0. Use Image to Data URI if you want the complete form.
No. The work happens in the page using the Canvas API and WebAssembly, so the file is read straight from your disk into the tab. Nothing is transmitted and there is no copy on a server to worry about.
No, the opposite. It grows by roughly a third, since every three bytes become four characters. Base64 exists to make binary data safe in text, not to compress it.
PNG, which is lossless and handles transparency. For a photograph that produces a long string, so compress it with Compress JPG first if size is a concern.
Browse every image tools, or jump straight to web & design.
Prevent stretched images by respecting aspect ratio and choosing explicitly between cropping, empty space, and a different frame.
Read guide →A 1200 × 630 Open Graph image is a strong link-preview baseline, but feeds, stories, and platform crops still need dedicated checks.
Read guide →A good PNG-to-ICO conversion starts with icon-scale artwork; shrinking a detailed logo to 16 or 32 pixels cannot preserve detail that no longer fits.
Read guide →