查找工具

↑↓ 选择 Enter 打开

不知道工具名称时,可输入“格式化”或“计数”等任务词。

Image to Base64 and Data URI

仅本地处理

Image to Base64 and Data URI 用于在浏览器中编码或解码内容,并清楚显示处理结果和限制。 本页包含该工具的实际输入输出、实现边界和一手参考资料。

已审核 · 更新于 · 免费使用 · 无需账号

Image Data URI Workspace
Image preview
The selected image stays in this browser tab.

Image to Base64 and Data URI可以处理什么?

Image to Base64 and Data URI 用于在浏览器中编码或解码内容,并清楚显示处理结果和限制。 已核对的功能: Image to Data URI, Base64 to image, MIME preservation, Local file download.

Use Data URIs only for small embedded assets

Base64 expands binary data by about one third before the data-URL prefix and cannot be cached independently when embedded in HTML or CSS. Prefer ordinary image files for large or reusable assets.

如何使用?

  1. For Image → Data URI, choose an image and select Convert image.
  2. For Data URI/Base64 → Image, switch Conversion mode and paste the encoded value.
  3. Check the MIME type or preview before copying the Data URI or downloading decoded bytes.

实际输入输出示例

Decode a MIME-aware PNG Data URI

输入

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=

输出

MIME: image/png
Download: decoded-output.png

The data URL supplies both the media type and Base64-encoded bytes needed to reconstruct the local Blob.

常见错误与修复方法

现象可能原因修复方法
Decode reports an invalid character error.The payload contains non-Base64 characters, lost padding, or a copied header that is not a data URL.Provide raw Base64 or a complete data:[type];base64,... value without surrounding quotes.
The decoded preview is broken even though bytes were produced.The declared MIME type does not match the encoded file or the bytes are not a valid image.Verify the source file signature and use the correct image media type.

Important behavior of Image ↔ Base64

该工具的实际边界: Base64 increases payload size by roughly one third and is usually unsuitable for large web images.

标准与实现参考

关于Image ↔ Base64的常见问题

Does the Image ↔ Base64 upload my input?

No. Processing runs in the current browser tab, and the page does not send tool input to a KitLumi processing endpoint.

What input does the Image ↔ Base64 accept?

It accepts an image file, Data URI, or raw Base64 image payload. The workspace checks the input and reports malformed or unsupported values before it produces a result.

What does the Image ↔ Base64 produce?

It produces a MIME-aware Data URI or decoded image file. Copy and download controls appear when the output format supports them.

What limitation should I know?

Base64 increases payload size by roughly one third and is usually unsuitable for large web images.

更新记录

本次实质更新: Image ↔ Base64: Added Image to Data URI, Base64 to image, MIME preservation, Local file download, responsive controls, explicit runtime disclosure, and task-specific examples and limitations.

谁在维护这个工具?

KL
KitLumi EngineeringKitLumi 工程团队负责维护工具行为、隐私说明、示例和自动化测试。