Trình mã hóa Base64
Mã hóa văn bản hoặc tải lên bất kỳ tệp nào và nhận chuỗi Base64 ngay lập tức. Chọn đầu ra an toàn cho URL hoặc ngắt dòng 76 ký tự, sau đó sao chép hoặc tải xuống kết quả.
Mọi thứ đều chạy trong trình duyệt của bạn. Dữ liệu của bạn không bao giờ được tải lên máy chủ của chúng tôi.
Text and files
Encode any text or upload a file such as an image, PDF or font to get its Base64 string.
URL-safe and wrapped
Switch to URL-safe output or wrap lines at 76 characters for email and PEM formats.
Private by design
Encoding happens in your browser. Nothing is uploaded or stored.
Why use our Base64 Encoder?
Private and secure
Your text and files stay on your device. Nothing is uploaded, stored or logged.
Instant and accurate
UTF-8 safe encoding with the size before and after shown right away.
URL-safe and MIME options
Get URL-safe Base64 without padding, or 76 character wrapped lines for email.
Free forever
No sign-up and no watermark. Works on phones and computers.
Free Online Base64 Encoder for Text and Files
The DailyOnWeb Base64 encoder converts text, images, PDFs and any other file into a Base64 string in one click. Developers use it for data URIs, API payloads, email attachments, config values and tokens. The encoder is UTF-8 safe, offers URL-safe output and runs in your browser with no sign-up.
How to encode text or a file to Base64
- Paste your text into the input box, or click Choose file to load a file.
- Optionally tick URL-safe or Wrap at 76 characters.
- Click Encode.
- Copy the Base64 output or download it as a text file.
What is Base64 used for?
- Data URIs: embed a small image or font directly in HTML or CSS with
data:image/png;base64,.... - APIs and JSON: send binary content such as a file or signature inside a text field.
- Email: MIME attachments are Base64 encoded, wrapped at 76 characters per line.
- Basic authentication and tokens: credentials and token parts are Base64 encoded for transport.
Standard Base64 vs URL-safe Base64
Standard Base64 includes the characters +, / and =, which can break links and query strings. The URL-safe variant uses - and _ and drops the padding, so the result can sit in a URL, a filename or a cookie without extra escaping. If you still need to place a standard string in a link, run it through URL encode.
Important to know
Base64 is not encryption and it makes data about one third larger. Do not use it to protect secrets, and avoid embedding large images as Base64 in pages because they cannot be cached separately. For photos, compress the image first to keep the string short.
More free developer tools
Reverse the process with the Base64 decoder. Working with data formats? Use the JSON formatter and the JSON to XML and CSV converter. Build links with URL encode and URL decode, generate identifiers with the UUID generator, or test your password with the password strength checker.
Explore all the free utility tools on DailyOnWeb for coding, text, generators and everyday tasks.
Câu hỏi thường gặp (FAQs)
Công cụ liên quan
Giải Mã Base64
Giải mã Base64 thành văn bản hoặc tải xuống dưới dạng tệp. Hỗ trợ Base64 an toàn cho URL và URI dữ liệu.
Mã Hóa URL
Mã hóa phần trăm (percent-encode) văn bản cho URL và chuỗi truy vấn. Chế độ thành phần, URL đầy đủ và biểu mẫu.
Giải Mã URL
Giải mã các URL và chuỗi truy vấn được mã hóa phần trăm thành văn bản dễ đọc, kèm theo bảng tham số.
Định Dạng JSON
Định dạng, xác thực và thu gọn JSON trực tuyến với thông báo lỗi rõ ràng và số dòng.