它到底是什么
Base64 不是压缩,也不是加密,只是一种把字节写成可打印字符的表示法。编码之后体积反而会变大,所以适合用在邮件、网页内嵌、接口字段这类「只能传文字」的地方,不适合拿来存大文件。
怎么用
把文字或图片贴进输入框,选编码或解码,结果直接出现在页面上。要嵌图时,用工具生成的 data URI 替换 HTML 或 CSS 里的图片地址即可,不用另外上传文件。
免费档给到哪
原条目写明无需注册、在浏览器里完成。没有次数限制,也没有账号体系,关掉页面数据不会留在服务器上。
强在哪、弱在哪
好处是随手可用、结果立刻能复制;局限是它只管表示,不管安全——任何人都能解回来。把密码、令牌编成 Base64 当作保护,是常见误解。
适合谁
前端要内嵌小图、后端在排查一段接口里的编码文本、或者只是想把不可读的字节看一眼的人。
常见问题
编码后为什么变长了?
每 3 个字节要写成 4 个字符,体积约增加三分之一,这是表示法本身的代价。
能用来传图片吗?
可以。原条目支持把图片转成 data URI,直接写进 HTML 或 CSS。
它算加密吗?
不算。解码不需要密钥,别用它保护任何敏感内容。
关于原文与更新
本页中文部分按中文习惯重写,只转述原条目已有的事实,不新增功能承诺。下面是原站评测全文,一字未删照搬,便于逐条核对;第三方服务的功能与免费额度会变,以英文原条目和对方官网为准。
原站评测全文(英文原文,照搬)
Base64 Encode / Decode
Base64 turns binary data into plain text so it can travel through systems that only accept characters. This tool encodes and decodes it, and converts images into embeddable data URIs.
What It Is
Base64 is a way of representing binary data using 64 printable characters. It is not encryption — anyone can decode it instantly — but it solves a real transport problem: email bodies, JSON payloads, HTML attributes and some APIs cannot carry raw bytes, and Base64 makes them portable as text.
The most common everyday use is the data URI: encoding a small image into a string you can paste directly into HTML or CSS, removing an extra HTTP request. It is ideal for tiny icons but counterproductive for large images, because Base64 inflates size by roughly 33% and cannot be cached separately.
The tool handles both text and file input, in both directions.
How To Use It
- Go to base64encode.org.
- Choose encode or decode, then pick text or file input.
- Paste your text or select an image file.
- Run the conversion and copy the output.
- For images, copy the data URI and paste it into an img src attribute or CSS url().
Free Plan Details
| Registration | Not required |
|---|---|
| Watermark | None |
| Cost | Free |
| Directions | Encode and decode |
| Input types | Text and files (including images) |
| Image output | Data URI ready for HTML/CSS |
| Size overhead | Approximately 33% larger than the original binary |
| Processing | Browser-side |
Check before you rely on it: free quotas, file limits and pricing change frequently. Confirm current terms on the official site before depending on it for regular work.
Strengths And Limitations
What works well
- Handles both text and file encoding
- Produces ready-to-paste data URIs for images
- No registration, instant results
- Works in both directions
- Useful for embedding icons without extra requests
Limitations
- Base64 is not encryption — never use it to hide data
- Roughly 33% size overhead makes it unsuitable for large files
- Very large inputs can be slow in the browser
- No batch processing
Who Should Use It
Developers embedding small images in HTML or CSS, debugging API payloads, and anyone who has received a Base64 string and needs to see what is inside it.
Frequently Asked Questions
Is Base64 encryption?
No. It is an encoding for transport, reversible by anyone instantly. Never use it to protect data.
Is this tool free?
Yes, encoding and decoding are free with no registration.
How much bigger does Base64 make a file?
About 33% larger than the original binary, which is why it is best reserved for small assets.
Should I embed large images as Base64?
No. It bloats the file and prevents separate caching. Use it for small icons only.
Can I decode an image back from a Base64 string?
Yes, the decode direction restores the original file.
What is a data URI?
A string like data:image/png;base64,... that you can use directly as an image source in HTML or CSS, avoiding an extra network request.