Convert ASCII to Base64

Encode text to Base64 - Unicode, URL-safe variant, optional 76-char line wrap. Free, client-side, instant, offline, secure.

Encode text — ASCII, Latin-1, CJK, or emoji — as Base64 in your browser. Optional URL-safe variant (-_ instead of +/) and MIME-compliant 76-column line wrap.

How to Use Convert ASCII to Base64

  1. Type or paste text into the input. ASCII, Latin characters, CJK, and emoji are all accepted. The output recomputes within 150 ms of your last keystroke.
  2. The Unicode pipeline is safe - text is UTF-8-encoded via TextEncoder before passing through btoa, so characters outside the Latin-1 range (which would throw a raw btoa) work cleanly.
  3. Tick "URL-safe variant" if you need RFC 4648 §5 output - + becomes - and / becomes _, which is safe to drop into URLs or filenames without percent-encoding.
  4. Tick "Strip = padding" (only available in URL-safe mode) to remove trailing = characters. Some decoders accept unpadded URL-safe Base64 and it shortens the string slightly.
  5. Tick "Line-wrap at 76" when the consumer expects MIME (RFC 2045) formatting - emails and many older APIs require a line break every 76 output characters. Leave it off for JSON or URL embedding.
  6. Read the stats line: input characters, UTF-8 input bytes, Base64 output characters, and the size-ratio percentage. Standard Base64 sits around 133-137 % of the input bytes; line-wrap and UTF-8 overhead for non-ASCII push the ratio higher.
  7. Copy, Download .txt, or press Ctrl+Enter (⌘+Enter on Mac) to run the encode and copy the result in one shortcut. Reset returns all three toggles to off.

Frequently asked questions

What is Base64?

A binary-to-text encoding that represents 3 input bytes as 4 output characters from a 64-symbol alphabet (A-Z, a-z, 0-9, plus + and /, or - and _ in the URL-safe variant). It was originally designed for sending binary attachments through 7-bit email pipes.

Is Base64 encryption?

No. Base64 is reversible without a key – anyone can decode it. It is an encoding, not encryption, and should never be used as a security measure.

Why use Base64?

To move bytes through channels that only tolerate text: emails (MIME), JSON, URLs, CSS data-URIs, HTML src="data:…" attributes, JWT payloads, and most REST/GraphQL APIs that ship binary blobs inside JSON strings.

Is my text secure?

Yes. Encoding runs entirely in your browser – nothing is uploaded, cached, or tracked. After the page loads you can disconnect the network and keep encoding indefinitely.

Why is the output bigger than the input?

Standard Base64 represents every 3 input bytes as 4 output characters, so the output is 4/3 ≈ 1.33× the input size. MIME line-wrapping adds a little more overhead, and non-ASCII text grows further because UTF-8 uses 2-4 bytes per character.

Does it work offline?

Yes. HTML, CSS, and JavaScript are self-contained. Once the page has loaded, you can turn off Wi-Fi and keep encoding – useful on air-gapped machines.

Is it free?

Yes, 100% free with no cap on input length or number of encodes. No sign-up, no premium tier, no watermark.

What is the URL-safe variant?

The RFC 4648 §5 alphabet swaps + for - and / for _, because the standard characters have meaning in URLs (+ becomes a space) and filenames (/ is a path separator). Used by JWT, OpenID Connect, and many REST APIs.

Does this tool handle raw binary files?

No – it takes text input only. The text is UTF-8-encoded before Base64, which covers any Unicode string, but arbitrary binary files (images, archives, etc.) need a different tool that accepts file uploads. Pasting binary bytes as text will not round-trip.

How do I decode Base64 back to text?

Use the sibling Base64 to ASCII converter. It accepts both the standard and URL-safe alphabets, with or without padding, so the output of this tool pastes back cleanly regardless of which toggles you used.