PrivTab

Ảnh sang Base64

Ảnh sang Base64

Chạy trong trình duyệt · Không tải lên

Hiện tại công cụ này và hướng dẫn trên trang vẫn bằng tiếng Anh. Nó hoạt động y như vậy: mọi thứ chạy trong trình duyệt của bạn.

Drag & drop an image here

or

Any image format (Base64 text gets very long for big pictures)

Your files stay on your device. Nothing is uploaded.

  • Không có gì rời khỏi thiết bị của bạn
  • Máy chủ không giới hạn kích thước
  • Không đăng ký, không hình mờ
  • Miễn phí

How to convert an image to Base64

  1. Choose an image.
  2. Pick the output: data URL, Base64 only, HTML <img> tag or CSS background.
  3. Copy the result or save it as a .txt file.

When to use Base64 images

  • Small icons and logos inside HTML emails or single-file pages.
  • Images inside JSON or other text-only formats.
  • Avoid it for large photos: Base64 text is about one third larger than the file, and the browser cannot cache it separately.

Is my image uploaded?

No. Your image is processed locally in your browser and never leaves your device. This site has no upload feature, and its security policy blocks the page from uploading anything.

Câu hỏi thường gặp

What is the difference between a data URL and Base64?

A data URL is the Base64 text with a prefix such as data:image/png;base64, that tells the browser the type. Use the data URL in src attributes and CSS; use plain Base64 when a program asks for the encoded data only.

Why is the Base64 text bigger than my image?

Base64 uses 4 text characters for every 3 bytes, so the result is about 33% larger than the original file.

Is the image changed?

No. The file bytes are encoded exactly as they are, so decoding gives back an identical file.

Is my image uploaded?

No. Encoding happens in your browser.