Base64 编码解码器
文本与 Base64 双向互转:支持 URL-safe 模式、图片转 dataURL、一键复制与下载。全部在浏览器本地计算,无任何上传。
Drop an image here or click to browse
PNG · JPG · GIF · WebP · SVG · AVIF — decoded Base64 preview, image info, copy data URL or download.
What is Base64?
Base64 maps 3 bytes of binary data onto 4 ASCII characters (A–Z, a–z, 0–9, + and /, with = padding), so data can travel through text-safe channels like JSON, XML, data URLs and e-mail. It is encoding, not encryption — anyone can trivially decode it, so never use it to “hide” secrets. Base64 also inflates data by roughly +33% (more with line breaks or URL-safe variants).
This page supports the standard and URL-safe alphabets (- _ instead of + /), tolerates missing padding, and strips whitespace automatically. Text uses UTF-8, so any language and emoji encode correctly.
如何使用Base64 编码解码器
把任意文本粘贴进输入框,左右两栏实时互转——编码与解码在同一个输入上双向生效。需要放进查询参数或 JWT 时开启 URL-safe 模式;更长的内容用复制按钮或下载链接带走。图片文件可直接拖入转成 dataURL,直接内嵌进 CSS 或 HTML。
典型用途:把小图片内嵌为 data URL、在 JSON 字段里搬运二进制形态的数据、阅读 Authorization: Basic 这类请求头。要记住 Base64 只是传输格式而非加密——任何拿到字符串的人都能解出来,传输归它管,保密不归它管。