Base64 编码/解码

输入

输入要编码的文本
0 个字符

选项

URL 安全模式将 + 替换为 -,将 / 替换为 _,以便在 URL 中安全使用。

输出

Base64 编码结果
0 个字符

关于此工具

Base64 编码器/解码器 已本地化为简体中文。可用于验证、转换、检查和导出结果,无需把数据上传到服务器。

使用方法

Base64 编码器/解码器 已本地化为简体中文。可用于验证、转换、检查和导出结果,无需把数据上传到服务器。

限制与重要说明

Base64 编码器/解码器 已本地化为简体中文。可用于验证、转换、检查和导出结果,无需把数据上传到服务器。

Technical Details

Edge Cases & Tricky Inputs

  • UTF-8 multi-byte characters (emoji, CJK) are encoded correctly — each byte is mapped independently.
  • URL-safe Base64 replaces + with - and / with _ to avoid URL encoding issues.
  • Padding characters (=) can be omitted in some implementations but are included by default here.

Performance & Processing

  • Encoding/decoding runs via the browser's built-in btoa()/atob() for ASCII, with a TextEncoder fallback for UTF-8.
  • Files up to 5 MB can be encoded without issues on modern browsers.

Developer Notes

  • Base64 increases data size by approximately 33% — consider this for bandwidth-sensitive applications.
  • Data URIs using Base64 are supported in all modern browsers for images, fonts, and CSS.

Known Limitations

  • Not encryption — Base64 is trivially reversible and provides zero security.
  • Very large files may cause browser memory pressure during encoding.

Related Tool Collections