Base64 Encode / Decode|Base64 转换工具

Base64 Encode / Decode|Base64 转换工具

Base64 转换工具 Base64 Encode / Decode

将普通文本快速编码为 Base64,或将 Base64 字符串还原为可读文本,适合前端调试、接口测试与简单数据嵌入场景。
Convert readable text to Base64 or decode Base64 back to readable text. Useful for debugging, API testing and embedding small data.

1. 输入与选项 · Input & Options
可输入任意 UTF-8 文本或 Base64 字符串,本工具会根据你选择的“操作类型”进行转换。
You can paste any UTF-8 text or Base64 string here. The tool will convert it according to the selected operation.

小提示:编码时请直接输入正常文本;解码时请确保内容为有效的 Base64 字符串,且长度通常为 4 的倍数。
Tip: For encoding, type plain text. For decoding, make sure the content is valid Base64, usually with length being a multiple of 4.
编码 Encode:将普通文本转换为 Base64 字符串,常用于 URL 参数、配置文件、简单数据隐藏等场景。
Encode: convert human-readable text to Base64 for URLs, configs or lightweight obfuscation.

解码 Decode:把 Base64 字符串还原为原始文本,便于阅读或继续处理。
Decode: transform a Base64 string back into its original text.
本工具按 UTF-8 处理文本,可正确支持中文、表情等多字节字符。
This tool uses UTF-8 for text, so it works with Chinese characters, emojis and other multi-byte text.
如果你在其他语言环境(如后端程序)中看到不同的结果,请确认对方是否也使用 UTF-8。
If you see different results in another environment (e.g. backend code), check if it also uses UTF-8.
3. Base64 简介 · About Base64
  • 什么是 Base64?· What is Base64?
    Base64 是一种将二进制数据用可打印字符表示的编码方式,常用于在文本环境中传输图片、文件片段或令牌等数据。
    Base64 is an encoding scheme that represents binary data using printable characters. It’s often used to move images, small files, or tokens through text-only channels.
  • 常见使用场景 · Common Use Cases
    在前端或接口调试中,Base64 常用于:
    In web development or API debugging, Base64 is often used for:
    – 将图片/文件嵌入到 JSON、HTML 或 CSS 中
    – Embedding images/files inside JSON, HTML or CSS
    – 对 Token、配置参数做简单封装(并非加密)
    – Wrapping tokens or config params in a simple, non-encrypted form
    – 在不方便传输二进制数据的场景中替代原始二进制格式
    – Transferring data in environments that don’t support raw binary formats
  • 注意:Base64 ≠ 加密 · Note: Base64 ≠ Encryption
    Base64 只是编码(Encoding),不是加密(Encryption),任何人都可以轻易解码得到原文,因此不适合作为安全手段使用。
    Base64 is encoding, not encryption. Anyone can reverse it, so it should not be treated as a security mechanism.

说明:本工具在浏览器本地运行,不会上传你的任何文本或数据到服务器,仅供学习、开发和日常使用中进行 Base64 转换与调试。
Note: All operations run locally in your browser. Your data is not uploaded anywhere. This tool is for learning, development and everyday Base64 conversions.