MDevTools

Base64 Encode / DecodeBase64 编解码

Encode or decode Base64 text with UTF-8 and URL-safe support.

对文本进行 Base64 编码或解码,支持 UTF-8 中文与 URL 安全字符集。

What is Base64 Encode / Decode?Base64 编解码 是什么?

Base64 encoding converts binary data into plain ASCII text so it can travel safely through text-only channels such as email, JSON, URLs and HTML attributes. This tool encodes and decodes in both directions with full UTF-8 support, plus a URL-safe variant that replaces the + and / characters. Because it runs locally, you can safely encode credentials, certificates or private payloads.

Base64 编码把二进制数据转换成纯 ASCII 文本,使其能安全穿过邮件、JSON、URL、HTML 属性等只支持文本的通道。本工具支持双向编解码,完整兼容 UTF-8,并提供 URL-safe 变体(替换 + 和 / 字符)。由于在本地运行,可以安全处理证书、密钥等敏感内容。

How to use base64 encode / decode如何使用 Base64 编解码

  1. Paste the text or Base64 string into the input box.
  2. Pick Encode to turn text into Base64, or Decode to turn Base64 back into text.
  3. Enable URL-safe mode if the value must be embedded in a URL or query parameter.
  4. Copy the output. UTF-8 input is handled correctly, so Chinese text round-trips without corruption.
  1. 把文本或 Base64 字符串粘贴进输入框。
  2. 选「编码」把文本转成 Base64,或选「解码」把 Base64 转回文本。
  3. 如果值要嵌入 URL 或查询参数,勾选 URL-safe 模式。
  4. 复制结果。UTF-8 输入双向一致,中文不会乱码。

Common uses常见用途

FAQ常见问题

Is Base64 encryption?Base64 是加密吗?

No. Base64 is an encoding, not encryption — anyone can decode it instantly. Never use it to protect secrets; use it only to make binary data safe to transport as text.

不是。Base64 是编码不是加密,任何人都能立刻解开。不要用它保护秘密,它只负责让二进制数据能以文本形式安全传输。

Why does decoded Chinese text come out as garbage?为什么解码中文出来是乱码?

That happens when the data was encoded as raw bytes rather than UTF-8 text. This tool assumes UTF-8 on both sides, which is the correct pairing for text.

这通常是因为原数据是按原始字节而非 UTF-8 文本编码的。本工具两端都按 UTF-8 处理,这是文本场景的正确组合。

What is URL-safe Base64?什么是 URL-safe Base64?

It swaps + for - and / for _ and drops padding, so the result can sit inside a URL or cookie without extra escaping.

它把 + 换成 -、/ 换成 _ 并去掉填充符,这样结果可以直接放进 URL 或 Cookie 而无需额外转义。

Can I encode a whole file?能编码整个文件吗?

Yes. Drop a file into the input to encode its bytes; the result is ready to embed as a data URI.

可以。把文件拖进输入框即可编码其字节,结果可直接作为 data URI 使用。

Other tools其他工具

🧾

JSON FormatterJSON 格式化

Format, validate and minify JSON — Chinese-safe, runs in your br…

格式化、校验并压缩 JSON,支持中文与错误定位。全程在浏览器本地完成。…

🔗

URL Encode / DecodeURL 编解码

Percent-encode or decode URLs, params and text.…

对网址、参数或文本进行 URL 百分号编码与解码,方便调试接口与链接。…

#️⃣

Hash Generator哈希生成

Generate MD5, SHA-1, SHA-256 or SHA-512 hashes.…

用 MD5、SHA-1、SHA-256 或 SHA-512 为文本生成哈希值,常…

🆔

UUID GeneratorUUID 生成

Generate random UUID v4 identifiers.…

一键生成多个随机 UUID v4,用于主键、追踪 ID 与测试数据。…

🎫

JWT DecoderJWT 解码

Decode a JSON Web Token locally, no upload.…

在浏览器本地解码 JSON Web Token 的 Header 与 Paylo…

🔎

Regex Tester正则测试

Test regular expressions and see matches live.…

实时测试正则表达式,查看匹配数量与命中内容,方便调试抓取与替换规则。…

Sister sites友情链接 MonkeyDev dev tools hub工具总站 FreePDFKit PDF toolsPDF 工具集 ImageToolKit image tools图片工具集 AI 咒语库 AI prompt libraryAI 提示词库 CalcKit finance calculators财务计算器 OfficeKit office utilities办公工具箱 AIkit AI & machine learningAI 与机器学习 DataKit data & spreadsheet tools数据与表格工具 ChartKit diagrams & charts图表与可视化 DocKit markdown & document toolsMarkdown 与文档工具