中文
Ad slot top
No ad code configured yet
Home›Developer Tools›Base64 Encoder & Decoder

Base64 Encoder & Decoder

Text and Base64 in both directions without mangling non-Latin characters, plus a file-to-DataURL helper.

Convert a file to Base64

Click to choose a file, or drop it here Best for small icons and images — the DataURL can be inlined into CSS

Files under 100 KB are advisable; anything larger produces an unmanageable string.

Ad slot in_content
No ad code configured yet

How to use

  1. Paste the text —— Put the content into the box. Non-Latin characters are treated as UTF-8 automatically.
  2. Pick a direction —— "Encode to Base64" turns text into the familiar block of characters; "Decode Base64" restores the original.
  3. Convert a file —— The lower panel turns a small file into a DataURL you can paste straight into a CSS url().

About Base64 Encoder & Decoder

Base64 represents binary data using 64 printable characters, which makes the output about 33% larger than the original. That overhead buys you something valuable: binary data can travel through channels that only accept text. It is most often used to inline small icons directly into CSS or HTML, saving a network request.

The important caution: Base64 is an encoding, not encryption. Anyone holding the string can turn it back into the original in one step. Never use it to protect a password, a key or anything confidential.

This tool handles text as UTF-8 throughout, so accented letters and CJK characters survive the round trip. When you are interoperating with another system, confirm that it also assumes UTF-8 — that mismatch is the usual cause of garbled output.

FAQ

Why does decoded text come out garbled?

Because the original was not encoded as UTF-8 before being Base64-encoded. This tool assumes UTF-8 in both directions; check the same assumption at the other end of the pipeline.

Can I use Base64 as encryption?

No. It only changes the representation — anyone can reverse it instantly. Use a real cipher such as AES if confidentiality matters.

Is there a size limit for file conversion?

Not technically, but pages handle inline data comfortably up to about 100 KB. Beyond that you should serve the file over HTTP instead of embedding it.