Base64 Encode – Encode Text or File to Base64 Online Free
Convert text or binary data to Base64 encoding. Fast, secure, and privacy‑friendly Base64 encoder.
Encode text or files to Base64 online free. Fast RFC 4648 Base64 encoder for data URLs, email, and JWT.
Base64 Encode – Online Encoder
Convert any text or binary file to Base64 format. Base64 is widely used for transmitting binary data over text‑based protocols like email or embedding images in HTML/CSS.
How Base64 Works
Base64 takes 3 bytes (24 bits) and splits them into 4 groups of 6 bits, each mapped to a character from the set A-Z a-z 0-9 + /. Padding (=) is added if the last group has fewer than 3 bytes.
Example Encoding
Input text: "Hello"
UTF-8 bytes: 48 65 6c 6c 6f
Base64: SGVsbG8=
Input text: "Hello World"
Base64: SGVsbG8gV29ybGQ=
Code Example
// Python
import base64
text = "Hello World"
encoded = base64.b64encode(text.encode()).decode()
print(encoded) # SGVsbG8gV29ybGQ=
// JavaScript (Node.js)
const encoded = Buffer.from("Hello World").toString("base64");
console.log(encoded); // SGVsbG8gV29ybGQ=
Advanced Options
- Line wrapping: insert line breaks every 76 chars (MIME)
- Padding: include or omit trailing '='
- Input format: text, binary file, or hex string
Use Cases
- Embed images in HTML/CSS as data URLs
- Encode binary attachments for email (MIME)
- Store binary data in JSON or XML
- JWT token payload (but use Base64URL variant)
Frequently Asked Questions
Everything you need to know about this tool
FAQs
Binary-to-text encoding using 64 characters (A-Z, a-z, 0-9, +, /).
Yes.
Email attachments (MIME), embedding images in HTML/CSS, JSON web tokens, and data URLs.
Yes, up to 20 MB.
Yes, text is UTF-8 encoded first.
Yes, auto-delete after 1 hour.
Yes, with '=' to make length multiple of 4.
Use our Base64 Decode tool (url_id=3206).
20 MB.
Yes.
Encoded raw input.
Yes.
~2 seconds per MB.
Batch mode: up to 5.
A-Z, a-z, 0-9, +, / (RFC 4648).
No, but we have a separate URL Encode tool.
Yes.
All modern.
No.
Yes.
Encoded correctly.
Yes, JWT uses Base64URL.
Yes, use the encoded output as `data:image/png;base64,...`.
Up to 20 MB.
Expands data by about 33%.
Tags
#base64 encode#base64 encoder#encode to base64#base64 online#free base64 tool#rfc4648 base64#base64 padding#base64 for email#base64 data url#base64 image#base64 file#batch base64#base64 python#base64 javascript#base64 mime#base64 line wrap#base64 jwt#base64 from hex#base64 binary#best base64 encoder#online base64 free