SVG 转 Base64

将 SVG 图片转换为 Base64,包含 data URI、CSS 背景和 HTML 嵌入代码。

将文件拖放到此处,或从磁盘中选择。

最大文件大小:25MB

Frequently Asked Questions

Why convert images to Base64?
Base64 images eliminate HTTP requests for small assets. They are ideal for icons, favicons, and CSS backgrounds under 10 KB, reducing page load time.
When should I NOT use Base64 images?
Avoid Base64 for images larger than 10 KB. The 33% size overhead and inability to leverage browser caching make it inefficient for larger files.
How do I use a Base64 image in CSS?
Use it as a background: background-image: url("data:image/png;base64,..."); — paste the full data URI as the value.
How do I use a Base64 image in HTML?
Place the data URI directly in the src attribute: <img src="data:image/png;base64,..." /> — no external file needed.
Which image format produces the smallest Base64?
SVG for icons and illustrations, WebP for photographs. Always optimize the image before encoding to minimize the Base64 output size.
Do email clients support Base64 images?
Most modern email clients support inline Base64 images. However, some clients like older versions of Outlook may block them. Always test with your target audience.