跳到正文

STEMSTUDIO

Encode or decode Base64

Text & files · converted on this device

Encode or decode Base64

Drop a file to get its Base64 (or data URL), or convert text and pasted Base64.

  • Free, no account
  • Nothing is uploaded

Help

Three bytes are cut into four six-bit numbers, each written as its place in this table. "=" is not data — it pads the length out to a multiple of four. The form used inside URLs, filenames and JWTs. Decoding accepts either form automatically. The form you can paste straight into HTML or CSS. Data URLs are defined with the standard +/ alphabet, so URL-safe substitution is not applied here.

Processing, communication and stored data

输入时即可双向转换文本,把文件转成 Base64 或 data URL,也能把粘贴的 Base64 还原成文件保存。非 ASCII 字符完整保留,无法解码时会告诉你哪一行的哪个字符有问题。

常见问题

表情符号和非拉丁文字能保留吗?

能——一切都按 UTF-8 编码,往返无损。如果对方系统假定了别的编码,那是另一个问题,这里无法解决。

我的 Base64 里有换行

原样粘贴即可。解码时会忽略换行、空格和制表符。大多数邮件传输按 76 列换行,这是正常的,不是损坏。

能处理多大的文件?

25 MB。转换时原始字节、中间字符串和 Base64 会同时存在于内存中,上限就是为此设的。很长的输出不会显示在页面上以保持流畅,但复制和保存仍作用于完整数据。

会上传什么吗?

不会。一切在页面中运行,关闭标签页就消失。但请记住 Base64 不是加密,无论把结果粘贴到哪里,都要当作原文可被读取。

能用它读取 JWT 吗?

粘贴用点分隔的第二部分,就能得到载荷 JSON;URL 安全字母表和缺少的填充都能处理。它不验证签名,所以内容能读,但无法确认真伪。

Ratings from users

Ratings appear once there are 10.

Report a problem or suggest something

The tool name, this page’s path and your browser type are sent with it. Files are never sent. For a reply, use the email on the Contact page.