Base64 编码 — 将二进制数据表示为文本的最常用方法之一。为电子邮件系统开发,它使用 64 个安全字符的集合来编码任何数据。今天 Base64 用于 Web 开发、API、数据存储和许多其他应用程序。
将纯文本、JSON 或任何 UTF-8 数据转换为 Base64 编码。
将 Base64 字符串即时解码为可读文本。
Base64URL / JWT
Decode URL-safe Base64 tokens (JWTs, API keys, OAuth)
对网页 URL 使用 - 和 _ 而不是 + 和 /
从输出末尾移除 =
为可读性保留空格
在解码前验证 Base64 输入的有效性
需要转换 JPG、PNG、SVG、WebP 或其他图像文件?请使用我们的图像转 Base64 转换器。
此工具最适合基于文本的 Base64 编码和解码。如需处理图像文件,请使用图像转 Base64 转换器。
Base64 是二进制数据的文本表示。它将任何数据 — 文本、文件或符号 — 转换为 64 个安全字符的集合(A-Z, a-z, 0-9, +, /)用于书写,并使用 = 进行填充。
这使其成为以下用途的理想选择:
示例:
当在 URL 或 API 端点中使用 Base64 数据时,+ 和 / 可能会破坏查询字符串。URL 安全 Base64 将它们替换为:
此变体移除填充,广泛用于 Web 令牌(JWT)和 REST API。
免费 Base64 编码器/解码器工具 — 任何想要将文本转换为 Base64 编码或将 Base64 解码为可读文本的人的理想工具。无论您是使用 API 的开发者、学习数据传输的学生,还是只是需要为项目转换数据,我们的转换器使使用 Base64 编码变得简单。
Base64 转换器的主要功能包括:文本和 Base64 之间的即时转换、支持所有国际字符和语言、URL 安全和无填充选项、严格验证和错误处理、实时统计、以及完全免费使用无需注册。
Base64 编码器/解码器是一个在线工具,让您输入任何文本并立即查看 Base64 版本。您也可以通过将编码的 Base64 文本粘贴到转换器中将其解码回中文文本。
这使得该工具对开发者、学生和任何从事数据传输和 API 工作的人都有用。
Base64 字母表包含 A–Z、a–z、0–9 和 + 和 / 符号。每 3 字节组转换为 4 个 Base64 字符:
= 用于填充
通过练习这些转换,您可以理解 Base64 的工作原理以及如何在项目中使用它。
使用在线 Base64 转换器有很多原因:
这解释了为什么"base64 编码器在线"搜索快速增长 — 人们通过 Web 开发、API 和数据存储重新发现 Base64。
Base64 解码反向工作:不是将文本编码为 Base64,而是读取编码的 Base64 文本并将其转换为纯中文。
当您在 API、配置文件或数据库中遇到 Base64 数据并想快速理解它时,此功能很有用。
当在 URL 或 API 端点中使用 Base64 数据时,+ 和 / 可能会破坏查询字符串。URL 安全 Base64 将它们替换为:
添加 URL 安全选项有助于使 Base64 转换在 Web 应用程序和 API 中更好地工作。
To encode: paste or type UTF-8 text (including JSON, URLs, or emoji), keep the direction on encode, adjust URL-safe or padding options if you need them, and run the conversion—the output appears as a Base64 string with live validation. To decode: switch to decode mode, paste the Base64 string, and decode; the tool checks the alphabet and padding, then shows the original text. Everything runs in your browser with UTF-8 end to end.
Yes. The tool is free to use with no registration, no paywall, and no limit on how often you encode or decode. Processing stays on your device, so your input is not uploaded or stored on our servers.
No. Base64 is encoding, not encryption. Anyone can decode standard Base64 without a secret key. It does not hide meaning—use real cryptography when you need confidentiality, integrity, or authentication.
Base64 represents binary data as ASCII text so it can travel safely through systems that only handle text—email (MIME), JSON payloads, URLs, logs, and config files. APIs often use it for small binary blobs or tokens embedded in text. The trade-off is size: encoded data is roughly a third larger than the raw bytes.
Yes. The tool works with UTF-8 text. Any character your browser can represent in UTF-8—including accented letters, symbols, and emoji—can be encoded to Base64 and decoded back when the whole pipeline uses consistent UTF-8.
Standard Base64 uses + and /, which can be problematic in URLs and some query strings. URL-safe Base64 typically replaces + with - and / with _, and may handle padding differently. This tool lets you toggle URL-safe output when you need strings that travel cleanly in web addresses, cookies, or tokens.
This page is optimized for text. To work with images you usually convert them elsewhere (for example to a data URL or another binary workflow), then paste the resulting text here if you want to inspect or practice Base64 on that string—not raw binary upload.
The implementation follows common Base64 rules (RFC 4648 style): 64-character alphabet, grouping into 24-bit chunks, padding with = when needed, and UTF-8 for text. Validation helps catch malformed input before decoding.
For the UTF-8 string "Hello World!", a typical Base64 value is SGVsbG8gV29ybGQh. The exact characters can vary slightly if you change URL-safe or padding options.
Base64 turns every 3 bytes into 4 encoded characters. When the input length is not a multiple of 3, the encoder adds padding characters—usually =—so the output length stays a multiple of 4. Decoders use padding to know how many bits in the last group are real data versus fill. Padding is not part of the 64-letter alphabet; it signals how the last block was encoded.
在线 Base64 编码器/解码器工具专为开发者和爱好者设计。输入您的姓名、最喜欢的名言或秘密消息,看看它在 Base64 中的样子。一键即可:
快速、简单、永远免费。
免费在线工具,用于转换、编码和处理文本