全部工具

Base64 互转

文本、图片与文件编解码,支持 Base64URL、Data URL 和 HEX
输入数据0
编码与校验设置
嵌入代码设置
开发者示例
// UTF-8 text -> Base64; raw File bytes use file.arrayBuffer().
const bytes = new TextEncoder().encode('Hello 世界');
let binary = '';
for (const byte of bytes) binary += String.fromCharCode(byte);
const encoded = btoa(binary);
const decoded = Uint8Array.from(atob(encoded), c => c.charCodeAt(0));
console.log(new TextDecoder('utf-8', {fatal: true}).decode(decoded));
// Base64URL: replace + with -, / with _, then remove trailing =.
// For large files, chunk on 3-byte boundaries in a worker.

单文件 16 MiB · 单次输入 24 Mi 字符 · 批量 100 条 / 合计 32 MiB。

转换数据仅留在当前标签页。Base64 是编码,不是加密。

转换结果
输入数据或选择本地文件。

Base64 会增加体积,不会压缩或保护数据。

运行时就绪JavaScript / Web Worker
无服务端上传 · 本地沙箱内存执行