Binatomy
转换器

图片转 Base64

上传或拖放图片,立即获得其 Base64 Data URI,并提供可直接使用的 HTML 和 CSS 代码片段。全部在浏览器中完成,无需上传

将图片拖放到此处

或

浏览文件

PNG、JPG、GIF、SVG、WebP...

常见问题

常见问题

关于 Base64 图片你需要了解的一切

什么是 Base64 Data URI?

A Data URI is a string that embeds the content of a file (an image in this case) directly into the code, with no need for an external file. It has the format data:image/png;base64,XXXX where XXXX is the Base64-encoded image.

为什么编码后的图片比原图大?

Base64 encoding represents every 3 bytes of binary data with 4 text characters, so it increases the size by about 33%. That is why inlining in Base64 is only worthwhile for small images (icons, logos): it reduces HTTP requests, but for large images a normal file is better.