# 在浏览器中运行的图片转 Base64 工具

> 拖入图片，复制为 Base64、data URI、HTML <img> 标签、CSS 背景、JSON、Markdown 或 favicon 链接。免费、无需账号、不上传任何内容。 新账号验证邮箱后一次性获得 4 个免费积分。够生成一次 AI 替代文本（4 积分）。

base64img.com 是独立网站，与 Google、Recraft 或任何模型提供方均无关联。

## 使用方法

1. 拖入、粘贴或选择最多 20 张图片（PNG、JPG、GIF、WebP、SVG、AVIF、BMP 或 ICO；单张最大 25 MB），或通过网址获取。
2. 选择输出：纯 Base64、data URI、HTML、CSS、JSON、Markdown 或 favicon。选项：URL 安全字符、76 字符换行、SVG 输出为 UTF-8 data URI。
3. 查看体积判断：小于 10 KB 内联，大于 32 KB 链接文件。需要时压缩为目标大小的 WebP 或 JPEG。
4. 复制或下载 .txt。反向转换时，在解码器中粘贴 Base64，保存为原文件、PNG 或 JPG。

## 输出与解码

编码和解码在浏览器中运行，转换时图片从不上传。解码器支持纯 Base64 或 URL 安全 Base64、data URI、CSS url() 和 <img> 包装，按字节识别真实格式，补上缺失的填充，并指出错误字符或截断的位置。

## 可选 AI 附加功能

在用户同意并消耗积分的前提下，可上传图片生成替代文本（Gemini，Google；4 积分）、去除背景（Recraft；10 积分）或放大小图（Recraft Crisp Upscale；12 积分）。输入和结果在 24 小时后删除。Asset Pipeline 可一次处理最多 50 张图片。

## 每份积分背后的模型

替代文本由 Gemini（Google）撰写。去除背景使用 Recraft。放大使用 Recraft Crisp Upscale。转换不使用任何模型。base64img.com 是独立网站，与 Google 或 Recraft 无关联。

## 转换工具

- [Base64 转图片](https://base64img.com/zh/base64-to-image): 粘贴 Base64 或 data URI，还原图片及其真实格式、大小和像素；可保存为原文件、PNG 或 JPG。
- [PNG 转 Base64](https://base64img.com/zh/png-to-base64): 把 PNG 转为 Base64 或 data URI，附 HTML、CSS 和 JSON 代码片段；保留透明度。
- [Base64 转 PNG](https://base64img.com/zh/base64-to-png): 把 Base64 或 data URI 转为 PNG 文件，无论原来是什么格式。

## 价格

## Plans (monthly or yearly, cancel any time)

- **Inline: $5.33 a month** — 1,617 credits each month, valid 31 days.
- **Sprite Sheet: $16.73 a month** — 5,742 credits each month, valid 31 days.
- **Asset Pipeline: $35.47 a month** — 12,836 credits each month, valid 31 days.
- **Inline yearly: $53.27 a year** — 1,617 credits each month, valid 31 days.
- **Sprite Sheet yearly: $167.30 a year** — 5,742 credits each month, valid 31 days.
- **Asset Pipeline yearly: $354.70 a year** — 12,836 credits each month, valid 31 days.

Plans differ in how many AI extras can run at once (see the pricing page). Batch AI (up to 50 images in one run) and exports of more than 20 files in one ZIP are on Asset Pipeline only, checked on the server. Converting images to and from Base64 is free on every plan and without an account; it runs in your browser.

## Credit packs (one-time, credits never expire)

- **Byte Crate: $31.63** — 5,936 credits, never expire.
- **Kilobyte Crate: $54.37** — 10,830 credits, never expire.
- **Megabyte Crate: $97.13** — 20,010 credits, never expire.

Free: New accounts get 4 free credits once, after verifying their email address. Enough for one AI alt text (4 credits).

## What a credit buys

| Job | Credits |
| --- | --- |
| Image to Base64, Base64 to image, snippets, SVG mode, shrink | 0 |
| Alt text (Gemini, Google), per image | 4 |
| Background removal (Recraft), per image | 10 |
| Upscale (Recraft Crisp Upscale), per image | 12 |

AI inputs and results are deleted after 24 hours. Failed, timed-out or refused jobs are refunded automatically. Refunds: packs within 14 days of purchase, a plan's first payment within 5 days, while no more than 10% of the purchase's credits are used; the unused part is refunded pro-rata. Renewal charges are not refundable.

## 常见问题

### 图片转 Base64 工具免费吗？

免费。图片和 Base64 互转无需账号，也没有每日上限，因为它在你的浏览器中运行。只有可选的 AI 附加功能消耗积分：替代文本 4，去除背景 10，放大 12。新账号验证邮箱后一次性获得 4 个免费积分。

### 我的图片会被上传吗？

不会。编码、解码、体积检查和压缩都在你的设备上完成。只有当你使用 AI 附加功能并确认有权使用该图片时，图片才会上传，这份副本会在 24 小时后删除。

### 为什么 Base64 字符串比原文件大？

Base64 把每 3 个字节写成 4 个字符，所以大约大 33%，再加上 data URI 前缀的几个字符。服务器开启 gzip 可以挽回一部分。

### 图片应该内联成 data URI 吗？

小图可以：约 10 KB 以下，data URI 能省一次请求。超过 32 KB 会让 HTML 或 CSS 变臃肿且无法单独缓存，应链接文件。每个结果上的判断会告诉你属于哪种情况。

### SVG 用 Base64 还是 URL 编码？

通常用 URL 编码的 UTF-8：更短且仍可阅读。SVG 开关会显示两种长度并标出更短的一种。

### 我的 Base64 字符串无法解码，怎么回事？

多半是复制时被截断，或混入了多余字符。解码器支持 data URI、URL 安全 Base64、CSS url() 和 <img> 标签，会补上缺失的填充，并指出错误字符的确切位置。

### 支持哪些格式？

PNG、JPG、GIF、WebP、SVG、AVIF、BMP、ICO 和 TIFF 都按字节识别，与文件名无关。单张最大 25 MB，一次 20 张。

### AI 附加功能做什么？用的是哪些模型？

替代文本由 Gemini（Google）撰写，4 积分。去除背景使用 Recraft（10 积分），放大使用 Recraft Crisp Upscale（12 积分）。失败会退还积分。base64img.com 是独立网站，与这些公司无关联。

### Asset Pipeline 方案多了什么？

编码和解码在浏览器中运行，始终免费。Asset Pipeline 增加批量 AI（一次对最多 50 张图片生成替代文本、去除背景或放大图标），以及一键把超过 20 个文件导出为 ZIP、CSV 或 CSS 样式表。


---

Source: https://base64img.com/zh · Site index for AI agents: https://base64img.com/llms.txt · Full content: https://base64img.com/llms-full.txt
