# Image to Base64 — Convert an image to Base64 on Mac

Turn images into Base64 data URIs, ready to paste into HTML, CSS or JSON. Part of OneMacTools, 151 private tools in one native Mac app (macOS 26 or later); category: Images. Runs on your Mac; nothing is uploaded.

Get a data URI, a CSS background rule, an HTML <img> tag or plain Base64 for each image, copied to the clipboard and saved as text. The bytes are encoded exactly as they are, with no quality loss. It warns you when an image is large, since data URIs suit small images.

Page: https://www.onemactools.com/tools/image-to-base64 · Download: https://www.onemactools.com/download · Pricing: https://www.onemactools.com/pricing

## How to use it
1. **Drop your images.** Add one or more images, including SVGs.
2. **Choose what to copy.** A data URI, a CSS background rule, an HTML <img> tag, or plain Base64.
3. **Click Encode.** Each image is encoded exactly as it is, byte for byte.
4. **Paste it.** With “Copy to the clipboard” on, the result is ready to paste. Each image's text is also saved as a file named with “base64” in a dated folder in Downloads › OneMacTools.

## Options
- **Copy as:** Data URI, CSS background, HTML <img> or Plain Base64. Data URI is the general-purpose form; CSS background wraps it in a background-image rule; HTML <img> wraps it in an image tag with the file name as alt text; Plain Base64 is just the encoded data.
- **Copy to the clipboard:** On by default. Copies the result so you can paste it straight away. With several images, they're copied together, separated by blank lines.

## Tips
- Use data URIs for small images only, ideally under about 10 KB. Large ones bloat your HTML or CSS and can't be cached separately.
- Shrink the image first: optimise SVGs with SVG Optimiser and PNGs with Compress PNG before encoding.
- SVGs make good data URIs for icons in CSS, since they're small and stay sharp at any size.
- Edit the alt text in the HTML <img> output to describe the image, rather than leaving the file name.
- Use a format browsers support, such as PNG, JPEG, WebP or SVG. A HEIC data URI won't show in most browsers.

## Questions
**How do I convert an image to Base64 on a Mac?**
Drop the image onto Image to Base64, choose Data URI and click Encode. The result is copied to your clipboard and saved as a text file.

**How do I use a Base64 image in CSS?**
Choose CSS background. You get a complete background-image rule with the data URI inside, ready to paste into a stylesheet.

**How do I embed an image in HTML without a separate file?**
Choose HTML <img>. You get an image tag with the picture inside its src, which works anywhere HTML does.

**Why is the Base64 text bigger than my image?**
Base64 turns every 3 bytes into 4 text characters, so it's about a third larger. That's why it suits small images.

**Does converting to Base64 reduce quality?**
No. The file's bytes are encoded exactly as they are, so decoding gives back the identical image.

**Can I convert SVG to a data URI?**
Yes. SVG files are accepted and encoded with the image/svg+xml type, ready for CSS or HTML.
