跳到主要内容

图片 Base64 转换

UpBox优盒工具箱,免费图片 Base64 转换工具,图片转 Data URI 或纯 Base64,也能把 Base64 还原成图片并下载,本地处理。

无需注册 · 数据不上传No sign-up · nothing uploaded

图片转 Base64Image → Base64

先选择一张图片
先选择一张图片

Base64 转图片Base64 → image

粘贴 Base64 后点“还原图片”
粘贴 Base64 后点“还原图片”
本工具所有运算在本地浏览器完成,你的文件、文本不会上传到服务器

工具介绍

图片 Base64 转换支持两个方向:把本地图片编码成 Data URI 或纯 Base64 字符串,或把已有的 Base64 还原成可预览、可下载的图片。 This tool works both ways: encode a local image into a Data URI or raw Base64 string, or decode existing Base64 back into a previewable, downloadable image.

编码结果会显示原图体积与文本长度,方便判断是否适合内嵌到 CSS、HTML 或接口字段;解码会自动识别 PNG、JPEG、GIF、WebP。 Encoding shows the original file size next to the text length so you can judge whether it suits CSS, HTML or API fields; decoding auto-detects PNG, JPEG, GIF and WebP.

  • 双向转换Two-way conversion
  • Data URI 前缀开关Data URI prefix toggle
  • 体积对比Size comparison
  • 格式自动识别Automatic format detection
  • 本地处理Local processing

使用说明

  1. 左侧选择图片,自动生成 Base64。Pick an image on the left to generate Base64.
  2. 按需取消“包含 data URI 前缀”,再复制或下载。Toggle the data URI prefix off if needed, then copy or download.
  3. 右侧粘贴 Base64 字符串,点“还原图片”。Paste Base64 on the right and press Decode image.
  4. 核对格式与尺寸,下载还原后的图片。Check format and dimensions, then download the image.

常见问题

Base64 适合放多大的图片?What image size suits Base64?
建议单张控制在 50 KB 以内,否则文本会明显拖慢 HTML/CSS 加载,大图仍应使用独立文件。Keep each image under about 50 KB; larger text bloats HTML/CSS, so big images belong in separate files.
为什么解码提示长度不对?Why does decoding complain about length?
Base64 长度必须是 4 的倍数,复制时被截断或混入多余字符都会触发提示。Base64 length must be a multiple of 4; truncation or stray characters trigger the message.
支持 SVG 吗?Does it support SVG?
当前只处理位图(PNG / JPEG / GIF / WebP),SVG 建议直接作为文本内嵌。Raster formats only (PNG, JPEG, GIF, WebP); inline SVG as text instead.
图片会上传吗?Are images uploaded?
不会。编码与解码都在浏览器本地完成。No. Encoding and decoding both run locally in your browser.
广告位

此处为广告位,可放置你的推广素材

支持图片、文字或 HTML 代码,替换本区块内容即可投放

浏览其他分类