Turn an image into Base64 text or a data URL to embed in HTML, CSS or Markdown, checked to decode back to your exact file. Optional resizing first.
Initializing in your browser…
Convert images between PNG, JPEG, WebP, GIF and BMP (and AVIF where your browser supports it), one at a time or in a batch, and compare how big each format makes your picture.
Resize one photo or a whole batch to exact pixels, a percentage or a social media preset, with fit, fill and crop, or stretch, and save as JPEG, PNG or WebP.
Crop a photo by dragging a box or typing exact pixels, with aspect ratio presets, quarter turns, mirrors and shape cut-outs. PNG output keeps every pixel exactly.
The sample icon, a 96 by 96 PNG of 7,470 bytes, encoded as a data URL.
File
icon-96.png, 7,470 bytes Width: Original
Result
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABg... Base64: 9,960 characters Data URL: 9,982 characters (+33.6%) Decodes back to all 7,470 bytes: yes
Base64 writes every 3 bytes as 4 characters, so 7,470 bytes become 9,960 characters, and the data: prefix adds 22 more. That third extra is the price of embedding: the icon needs no separate download, but it cannot be cached apart from the page. The text was decoded again and matches the file byte for byte, and the image/png type comes from the file itself, not its name.
Convert an image into Base64 text you can paste straight into code: a data URL for an img tag or a CSS background, plain Base64, or ready-made HTML, CSS and Markdown snippets. It is the quickest way to embed small icons and logos without a separate file.
Embed small icons and sprites to save requests.
Include logos that show even when external images are blocked.
Keep images inside HTML or Markdown files that must travel alone.
Send images as text in data formats that only carry strings.
The 96 by 96 sample icon of 7,470 bytes becomes a 9,982 character data URL, 33.6 percent larger than the file.
Choose CSS to get a background-image rule for a small pattern or logo, ready for a stylesheet.
Resize the logo to 128 pixels first, then use the HTML output so the image travels inside the message.
Five outputs. Data URL gives the complete data: address. Base64 gives only the encoded text. CSS gives a background-image rule, HTML an img tag and Markdown an image line, each with the data URL inside. For SVG files there is a sixth, SVG text, which writes the drawing as readable, escaped text instead of Base64 and is usually shorter.
Exactly your file. By default the file is encoded as it is, byte for byte, and the result is decoded again and compared with your file before you copy it. The image type in the data URL comes from the file's own first bytes, so a PNG that was renamed .jpg is still labelled image/png and displays correctly; the page warns you when the name and the content disagree.
Smaller first, if you want. Under Make it smaller first, pick a width (64, 128, 256, 512 or 1024 pixels, or any width) to scale a large picture down before encoding, with a quality setting for JPEG and WebP and a choice of scaling filter. The page then says clearly that the result is a resized copy, not your original file.
What it costs. Base64 turns every 3 bytes into 4 characters, so the text is about a third larger than the file, and an embedded image cannot be cached separately from the page it is in. The page shows the file size, the number of characters and the exact percentage. Embedding suits small icons, logos and simple graphics; for large photos a normal image file is usually better. Copy the result or download it as a text file. Everything runs in your browser.
An address that contains the file itself instead of pointing to it, for example data:image/png;base64, followed by the encoded image. Browsers display it like any other image.
Base64 uses 4 characters for every 3 bytes, so it is about a third larger. The page shows the exact difference.
For small images such as icons and logos, where saving a separate download matters more than caching. For large photos, link to a normal image file instead.
Yes: a resized copy is a new, smaller picture saved again. Leave the width on Original to encode your file exactly.
Yes. You also get an SVG text option that keeps the drawing readable and is usually shorter than Base64.
No. The encoding happens in your browser.
Images are decoded, edited, and exported entirely inside this browser tab. No originals, exports, or metadata are uploaded.