Base64编码器 | 快速编码和解码数据
使用Base64编码器将文本转换为Base64格式,支持多种编码选项,确保数据在网络传输中的安全性。立即体验高效编码服务。
如何使用 Base64 编码器
- 1. 在输入字段中输入文本或选择要编码的文件
- 2. 点击“编码文本”或“编码文件”按钮
- 3. 复制生成的 Base64 字符串以在其他地方使用
- 4. 使用清除按钮重新开始
从你的AI智能体调用此工具
免费的JSON API和Model Context Protocol (MCP) 服务器。无需注册、无需API密钥、CORS开放。专为Claude、ChatGPT、Cursor、脚本和前端应用设计。
curl -X POST https://mate.tools/api/v1/base64-encode.php \
-H "Content-Type: application/json" \
-d '{"text":"hello world","url_safe":false}' import urllib.request, json
req = urllib.request.Request(
"https://mate.tools/api/v1/base64-encode.php",
data=json.dumps({"text":"hello world","url_safe":false}).encode(),
headers={"Content-Type": "application/json"},
)
with urllib.request.urlopen(req) as r:
print(json.load(r)) const r = await fetch("https://mate.tools/api/v1/base64-encode.php", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({"text":"hello world","url_safe":false}),
});
console.log(await r.json()); 添加到 claude_desktop_config.json(Claude Desktop)、~/.cursor/mcp.json(Cursor)或任何其他MCP兼容客户端:
{
"mcpServers": {
"mate-tools": {
"command": "npx",
"args": ["-y", "@mate-tools/mcp-server"]
}
}
} 常见问题解答
Base64 编码是一种将二进制或文本数据转换为 ASCII 文本格式的方法。当您需要在只能可靠处理文本内容的系统上传输二进制数据时,通常会使用它。
您可以将任何文本内容或文件(最大 5MB)编码为 Base64 格式。这包括纯文本、图像、PDF 和其他文件类型。
Base64 编码对于在 HTML/CSS 中嵌入图像、通过电子邮件发送文件、在数据库中存储二进制数据或传输可能在传输过程中被更改的数据非常有用。