Base64 编码器
将文本或二进制数据编码为 Base64。免费、隐私优先、100% 纯客户端运行。支持 UTF-8、ASCII、Latin1、UTF-16LE 字符集,可处理多语言文本与二进制内容,结果可直接用于 Data URI、邮件附件、JWT 等场景。
尝试示例:
Local only
最近历史
暂无历史
使用方法
- 在输入框中输入或粘贴文本。
- 选择所需的字符集。
- 复制或下载编码结果。
使用此工具的任务
修复常见 Base64 解码错误
为什么 Base64 字符串解码失败——缺失填充、URL 安全字母表、混入空白——以及每种情况的确切修复步骤。 任务
转换 data between Base32, Base58, Base64, Base85, and Base91
Translate 相同二进制载荷 across 不同进制 encodings used 通过不同 systems (Bitcoin, DNS, PDF, compact serialization). 任务
转换 hexadecimal string to Base64 and back
Translate 之间 hex dumps 和 Base64 representations 的相同二进制数据无 losing bytes 或 introducing padding 错误. 任务
解码 Base64 text and handle missing or corrupted padding
解码 Base64 payloads that arrive without trailing '=' padding or with URL-safe alphabet, and recover the original bytes safely. 任务
从 Basic Auth 头读取凭据
一次 Base64 解码、一次冒号分割,并清醒认识为什么 Basic Auth 凭据需要谨慎处理。 任务
编码 binary data into a JSON-safe string
转换 raw bytes (images, encrypted blobs, file contents) into a Base64 string that can be embedded inside a JSON field without breaking the structure. 任务
编码 a file into a Data URI for inline embedding
转换 a small image, font, or file into a data: URI so it can be embedded directly in HTML, CSS, or Markdown without a separate HTTP request. 任务
加密 text with AES and decrypt it back
Symmetrically 加密消息具有 passphrase using AES-256-GCM, 然后解密 ciphertext 具有相同键 到 recover 原始. 任务
加密 a large file with AES in chunks
加密 files too large for a single AES operation by processing them in chunks with a streaming mode, then decrypt to recover. 任务
安全 wipe sensitive 数据从 内存
Cryptographic 关键和 plaintext 必须是 zeroed 从内存之后 use. Learn 为什么 memset 是不 enough 和如何prevent compiler 优化. 任务
Use HTTP 基础 Authentication
基础 Auth sends credentials as Base64-encoded username:password 在 Authorization 头. Learn 格式化, 安全 requirements, 和 alternatives. 任务
Use Bearer tokens 为 API 认证
Bearer tokens 是 sent 在 Authorization 头: "Bearer <令牌>". Whoever holds 令牌能够 access API — protect 它 like password. 任务
Use CBOR 编码为 compact 二进制 JSON
CBOR (Concise 二进制 Object Representation, RFC 8949) 是二进制 serialization 格式化为 JSON-like 数据, smaller 和 faster than JSON. 任务
Use cookies 安全
Cookies 必须是 集合具有安全, HttpOnly, SameSite, 和 proper expiration. Learn Cookie attributes 和安全最佳实践. 任务
Use MessagePack 为高效二进制 serialization
MessagePack packs JSON-like 数据为 compact 二进制格式化, reducing 大小和 parsing 时间. Popular 在高-性能 APIs 和 IoT. 任务
Understand WebSocket 帧格式化
WebSocket frames 有特定二进制格式化具有 opcode, masking, 和载荷长度. Learn 到解码和 construct WebSocket frames. 任务
Verify 该编码-解码 round-trips losslessly
Confirm 该解码然后 re-编码 (或 vice versa) returns exact 原始输入, catching silent 数据 corruption 从错误 alphabets 或 padding. 任务
使用此工具的管道
Ascii85 转 Base64
管道
Base2048 转 Base64
管道
Base32 转 Base64
管道
Base58 转 Base64
管道
Base64 编码→解码→验证
管道
Blowfish 加密后 Base64
管道
DES 加密后 Base64
管道
为 URL 传输编码 JSON 载荷
管道
AES 加密后 Base64 编码
管道
内容哈希并 Base64 编码
管道
Hex 转 Base64
管道
HMAC 签名后 Base64 编码
管道
摩尔斯编码并 Base64 传输
管道
RC4 加密后 Base64
管道
RIPEMD-160 哈希后 Base64
管道
文本打乱后 Base64 编码
管道
Unicode 转义并 Base64 编码
管道
URL 编码后 Base64 双重编码
管道
UUencode 后 Base64
管道
生成 UUID 并 Base64 编码
管道
常见问题
- 什么是 Base64 编码?
- Base64 将二进制数据编码为 64 个可打印 ASCII 字符(A-Z、a-z、0-9、+、/)的集合,使其可以安全地在 JSON、XML 或邮件等仅支持文本的通道中存储或传输。
- 我的数据会被上传到任何地方吗?
- 不会。所有编码均在你的浏览器本地完成,没有任何服务器往返,工具完全可离线运行。
- 为什么输出以 '=' 或 '==' 结尾?
- Base64 将每 3 个字节编码为 4 个字符。当输入长度不是 3 的倍数时,用 '=' 填充使输出为 4 的倍数。一个 '=' 表示最后一组多 2 字节;'==' 表示多 1 字节。
- 支持哪些字符集?
- UTF-8(默认)、ASCII、Latin1 和 UTF-16LE。UTF-8 正确处理多语言文本;UTF-16LE 匹配 Windows API 的平台字节序。
- 可以编码二进制文件吗?
- 可以。使用文件选择器加载二进制文件,其字节将直接编码为 Base64,不经过任何文本解码步骤。
- 最大输入大小是多少?
- 除浏览器内存外没有硬性限制。对于几 MB 以上的输入,编码会在 Web Worker 中运行以保持界面响应。
相关工具
Base64 解码器
将 Base64 数据解码为可读文本。免费、隐私优先、100% 纯客户端运行。支持 UTF-8、ASCII、Latin1、UTF-16LE 字符集,可处理 Data URI、JWT 载荷、邮件附件等场景,遇到非法输入会明确报错而非静默产生乱码。 工具
Base32 编码器
将文本编码为 Base32(RFC 4648)。免费、隐私优先、100% 纯客户端运行。 工具
Base58 编码器
将文本编码为 Base58(Bitcoin 字母表)。免费、隐私优先、100% 纯客户端运行。 工具
十六进制编码器
将文本编码为十六进制。免费、隐私优先、100% 纯客户端运行。 工具
URL 编码器
对文本进行百分号编码,以安全地用于 URL。免费、隐私优先、100% 纯客户端运行。支持组件模式(编码所有保留字符)和完整 URL 模式(保留 ://? 等结构),支持 UTF-8/ASCII/Latin1/UTF-16LE 字符集,适合构建查询参数、路径片段和 API 请求。 工具