Converter Web ToolsConverter WebTools

Base64 Encode

Encode text to Base64 quickly and privately. The conversion runs in your browser.

Input
Output
Share Link
Settings

What is Base64?

Base64 is a binary-to-text encoding that represents data using 64 printable ASCII characters: A–Z, a–z, 0–9, plus + and /, with = used for padding. It works by taking 3 bytes (24 bits) of input at a time and splitting them into four 6-bit groups, each mapped to one Base64 character. Encoding to Base64 makes data safe to store or transmit through text-only systems — for example embedding images in HTML/CSS as data URIs, sending email attachments (MIME), or carrying tokens such as JWTs. Because every 3 bytes become 4 characters, Base64 increases size by about 33%. Importantly, Base64 is an encoding, not encryption: it provides no secrecy and anyone can decode it.

100% private: this Base64 encoder runs entirely in your browser. Your text and files are never uploaded to a server — everything is processed locally, and it is completely free with no sign-up.

How Base64 works

Base64 processes data in groups of three bytes (24 bits) at a time. Here is exactly how the word Man becomes TWFu:

  1. Convert each character to its ASCII value: M = 77, a = 97, n = 110.
  2. Write each value as 8-bit binary and join them into 24 bits: 01001101 01100001 01101110.
  3. Re-group the 24 bits into four 6-bit chunks: 010011 010110 000101 101110.
  4. Read each chunk as a number from 0 to 63: 19, 22, 5, 46.
  5. Map each number to the Base64 alphabet: 19 = T, 22 = W, 5 = F, 46 = uTWFu.

If the input length is not a multiple of three, the output is padded with one or two = characters so its length is always a multiple of four.

How to use

  1. Enter or paste your text in the input box.
  2. The Base64-encoded result appears instantly in the output.
  3. Click Copy to use the encoded value.

Examples

InputBase64
ManTWFu
HelloSGVsbG8=
foobarZm9vYmFy
Hello, World!SGVsbG8sIFdvcmxkIQ==

Options explained

  • Character set / encoding — Controls how your text is turned into bytes before encoding (UTF-8 by default; ASCII, ISO-8859 and other charsets are also supported).
  • Split into 76-character lines — Inserts a line break every 76 characters, as required by MIME for email (RFC 2045).
  • URL-safe (Base64URL) — Replaces + and / with - and _ so the result is safe in URLs, filenames and JWTs.
  • Live mode / Auto Update — Encodes instantly as you type, with no need to press a button.

Common uses

  • Data URIs — embedding images, fonts or files directly in HTML/CSS (data:image/png;base64,…).
  • Email — encoding attachments and non-ASCII content for MIME.
  • Tokens — JWTs and API keys are Base64URL-encoded for safe transport.
  • APIs — putting binary data inside text formats like JSON or XML.
  • HTTP Basic Authentication — the username:password header value is Base64-encoded.

Frequently asked questions

Is Base64 encryption?
No. Base64 is reversible and provides no security at all. Use real encryption (such as AES) to protect data.
Why does Base64 make data larger?
It encodes every 3 bytes as 4 characters, increasing size by roughly 33%.
What characters does Base64 use?
A–Z, a–z, 0–9, plus + and /. The = sign is padding so the length is a multiple of 4.
What is URL-safe Base64?
A variant (Base64URL) that replaces + and / with - and _ so the value is safe in URLs and filenames.
Where is Base64 used?
Data URIs, email attachments (MIME), JWTs, embedding binary in JSON/XML, and HTTP basic authentication.
How do I decode Base64?
Use the Base64 Decode tool to convert it back to the original text or bytes.