图片转 Base64
将图片拖放到此处
或
浏览文件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.
我的图片会上传到服务器吗?
No. The conversion happens entirely in your browser using the JavaScript FileReader API: the image never leaves your device and is not sent to any server. This makes the tool private and very fast, and it even works offline once the page is loaded.
