← UserToolbox
🔑 Base64 Encoder/Decoder

Free Online Base64 Encoder/Decoder

Encode text to Base64 or decode Base64 back to text, instantly. Full Unicode support for emoji, Chinese, Japanese, and any language — plain browser btoa() breaks on these, this tool doesn't. 100% in your browser, nothing uploaded.

What Is Base64 Encoding?

Base64 is a way of representing any data — text or binary — using only 64 printable ASCII characters (A–Z, a–z, 0–9, +, /), with = used for padding. It exists because many systems — email protocols, JSON documents, URLs, older text-only transports — were built to handle plain text reliably, but choke on raw binary bytes. Base64 converts that binary (or Unicode text) into a safe, text-only representation that any of those systems can carry without corruption. It's important to know that Base64 is not compression and not encryption — it's just a different way of writing the same data, and it makes the output about 33% larger than the original.

When Do You Need Base64?

Base64 shows up constantly in web development: embedding small images directly inside HTML or CSS as data URIs (data:image/png;base64,...) so the browser doesn't need a separate file request; email MIME encoding, which Base64-encodes attachments and non-ASCII message bodies so they survive transport through mail servers that only guarantee 7-bit ASCII delivery; the header and payload segments of JWT (JSON Web Token) authentication tokens, which are Base64URL-encoded JSON objects; HTTP Basic Auth headers, which Base64-encode the username:password pair; and embedding raw binary data (like a small file or a cryptographic key) inside a JSON or XML document that only supports text values.

Base64 编码解码工具

这是一个免费的在线 Base64 编码/解码工具,完整支持 Unicode 字符(表情符号、中文、日文等),而浏览器原生的 btoa() 函数在处理非拉丁字符时会报错。所有编码解码均在浏览器本地完成,不会上传或存储任何数据,适合处理 Data URI 图片嵌入、邮件 MIME 附件、JWT 令牌等场景。请注意:Base64 编码不是加密,不提供任何安全性。

Frequently Asked Questions

What is Base64 encoding?
Base64 is a way of representing binary data (or any text) using only 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It's used whenever data needs to pass through a system that only reliably handles text — like embedding an image inside HTML/CSS, attaching files to an email, or including binary data in a JSON payload.
Is Base64 encryption or a security feature?
No. Base64 is encoding, not encryption — it provides zero security. Anyone can decode Base64 text back to its original form instantly with no key or password required. Never use Base64 alone to "hide" passwords, tokens, or sensitive data; use real encryption (like AES) or hashing if you need security.
Does this tool work with Unicode, emoji, Chinese, or Japanese text?
Yes. This tool UTF-8 encodes your text before Base64-encoding it, so it correctly handles emoji, Chinese, Japanese, Korean, and any other Unicode text. The plain browser btoa() function only supports Latin1 characters and throws an error on anything outside that range — this tool avoids that limitation entirely.
Is it safe and private to use this Base64 tool?
Yes. All encoding and decoding happens entirely inside your browser using JavaScript. Nothing you type is uploaded, logged, or sent to a server. You can disconnect from the internet after the page loads and it will keep working.
What are common uses for Base64 encoding?
Common uses include embedding images directly in HTML or CSS as data URIs (data:image/png;base64,...), attaching files to emails via MIME encoding, encoding the header and payload segments of JWT authentication tokens, and embedding binary data inside JSON or XML documents that only support text.
What is URL-safe Base64 and how is it different?
Standard Base64 uses + and / characters, which have special meaning in URLs and file paths. URL-safe Base64 (used in JWTs and many web APIs) replaces + with -, / with _, and often drops the trailing = padding, so the result can be used directly inside a URL or filename without extra escaping.

Related Tools

Guides