Text & Code
Base64 Text Encoder / Decoder
Encode text to Base64 and decode Base64 back to text. URL-safe mode available.
Your files stay on your device - processed locally via WebAssembly, never uploaded
🔒 All encoding and decoding happens in your browser. Nothing is sent anywhere.
Embed this tool on your website
Copy this code to add the Base64 Text Encoder / Decoder to your site for free. It runs entirely in your visitors' browsers - no API key, no usage limits.
<iframe src="https://optipix.art/embed/base64-text" width="100%" height="600" style="border:1px solid #e4e4e7;border-radius:8px;" title="Base64 Text Encoder / Decoder by OptiPix" loading="lazy"></iframe> <p style="font-size:12px">Free tool by <a href="https://optipix.art/base64-text">OptiPix Base64 Text Encoder / Decoder</a></p>
❤️ Love this tool? Support our team.
No ads, no tracking, no limits. Tips keep 104 tools free for everyone.
Secure payment via Stripe · No account needed
About Base64 Text Encoder / Decoder
Last updated: May 2026
OptiPix Base64 文本编码器/解码器直接在您的浏览器中进行纯文本和 Base64 编码之间的转换。将任何 UTF-8 文本编码为 Base64,或将 Base64 字符串解码回可读文本。切换 URL 安全 Base64 模式,使用 - 和 _ 而不是 + 和 / 来兼容 URL 和文件名。启用实时模式,在您键入时进行实时转换。查看输入/输出大小统计信息,显示编码开销。拖放任何文件以将其字节编码为 Base64 字符串,或粘贴 Base64 字符串以解码并下载为文件。此工具处理文本和任意文件 - 对于带有预览和 CSS 输出的特定于图像的 Base64,请参阅图像到 Base64 工具。所有处理都在您的浏览器本地进行。
How It Works
该工具使用 JavaScript 的 btoa() 和 atob() 函数处理 ASCII 范围内的文本。为了获得完整的 UTF-8 支持,它首先使用 TextEncoder 编码文本,然后将字节数组转换为 Base64 字符串。URL 安全模式会将输出中的 + 替换为 -,将 / 替换为 _。
Use Cases
- •将 API 密钥和令牌编码到配置文件中
- •解码来自 API 和 JWT 的 Base64 编码数据
- •将文件转换为 Base64 以嵌入 JSON 载荷中
- •准备用于电子邮件 MIME 编码的数据
- •在 Web 应用程序中调试 Base64 编码的字符串
You Might Also Like
If you find Base64 Text Encoder / Decoder useful, check out these related tools: URL Encoder / Decoder, Text to Binary / Hex / Octal, and Hash Generator. All tools run entirely in your browser with no uploads or signups required.
Explore more: Browse all tools · Step-by-step guides · Tips & tutorials · Compare tools
Frequently Asked Questions
什么是 Base64 编码?
什么是 URL 安全 Base64?
我可以编码文件,而不仅仅是文本吗?
这与图像到 Base64 工具有什么不同?
我的数据会发送到任何服务器吗?
Related Tools
URL Encoder / Decoder
Encode and decode URLs with percent-encoding. Parse URLs into components.
Text to Binary / Hex / Octal
Convert text to binary, hexadecimal, octal, and decimal - and back.
Hash Generator
Generate MD5, SHA-1, SHA-256, SHA-384, and SHA-512 hashes from text or files.
Case Converter
Convert text between UPPERCASE, lowercase, Title Case, camelCase, snake_case, and 10+ more formats.