客户端处理 · 无需上传 · 100% 隐私
编码与解码 Base64
在浏览器中即时完成
将文字、图片、文件和 PDF 转换为 Base64,支持即时预览。所有操作在浏览器中完成,不上传任何数据。
无需注册 · 不存储数据 · 离线可用
Base64 转换器
即时将文本编码为 Base64 或解码回文本,支持标准和 URL 安全格式,实时转换。
Frequently Asked Questions
What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that represents binary data using 64 ASCII characters (A-Z, a-z, 0-9, +, /). It is commonly used to transmit data over text-only channels like JSON, XML, and email.
Is Base64 encryption?
No. Base64 is reversible encoding, not encryption. Anyone can decode a Base64 string without a key. Never use it to protect passwords or sensitive data.
Why does Base64 make data ~33% larger?
Base64 encodes every 3 bytes of input into 4 characters of output. This 4:3 ratio means the encoded result is always about 33% larger than the original.
What is URL-safe Base64?
URL-safe Base64 replaces + with - and / with _ to avoid conflicts with URL encoding. It is widely used in JWTs (JSON Web Tokens), data URIs, and query string parameters.
Can Base64 handle Unicode and emoji?
Yes. Text is first encoded to UTF-8 bytes, and those bytes are then Base64-encoded. This tool handles Unicode automatically.
When should I use Base64 for text?
Use Base64 when transmitting binary or special characters through text-only systems such as JSON payloads, XML documents, email headers, or URL query strings.
您需要的所有 Base64 工具
针对每种格式的专用转换器,每个都为其用例进行了优化。
文本转 Base64
将纯文本编码为 Base64,支持 URL 安全输出。
Base64 转文本
将 Base64 字符串解码为可读文本。
图片转 Base64
将 PNG、JPG、GIF、SVG、WebP 转换为 Base64,含 CSS 和 HTML 代码。
Base64 转图片
解码 Base64 字符串并实时预览图片。
文件转 Base64
拖放任意文件转换为 Base64,最大支持 25 MB。
Base64 转文件
将 Base64 解码并下载为原始文件,自动检测文件类型。
PDF 转 Base64
将 PDF 文档编码为 Base64,用于嵌入或传输。
Base64 转 PDF
解码 Base64 字符串并下载为 PDF 文件。
十六进制 ↔ Base64
在十六进制和 Base64 之间自由转换。
验证 Base64
检查字符串是否为有效 Base64,含填充和变体诊断。
代码示例
JavaScript、Python、PHP 和 Go 中的 Base64 示例代码。
Base64 图标
浏览 6,000+ SVG 图标,一键复制 Base64 或 CSS 代码。