Utilo

Text to Base64 Converter – Free, Online, Private

Encode a UTF-8 string as Base64. Emoji and non-Latin text are encoded from their UTF-8 bytes, not from UTF-16 code units.

Input
Output

How to convert Text to Base64

  1. Type or paste the text. The sample is Hello, Utilo!
  2. The page encodes UTF-8 bytes with the standard alphabet.
  3. Copy the result. Padding with = is included when the length requires it.

UTF-8, then Base64

Base64 is an encoding of bytes. The text is turned into UTF-8 with TextEncoder, then those bytes are encoded. That matches what almost every server library does for a string. Encoding UTF-16 code units instead would disagree with btoa of a naive binary string and with Python's base64.b64encode(s.encode()). The sample Hello, Utilo! becomes SGVsbG8sIFV0aWxvIQ==. The comma and the space are single bytes, and the exclamation mark is the last byte, so the padding is two equals signs. An empty string encodes to an empty string. A string that is only an emoji uses the four UTF-8 bytes of that code point.

Alphabet

The alphabet is A–Z, a–z, 0–9, + and /. This is not URL-safe Base64. + and / and = will be escaped if you drop the string into a query parameter. Use the URL encode page on the result, or switch to the main Base64 tool if you need the - and _ alphabet. Line wraps are not inserted. MIME's 76-column wrap is a transport rule, not part of the data. A decoder that rejects whitespace will accept this output directly. Newlines in the input are encoded as the bytes of the newline, so they survive a round trip through the decode page.

Worked example

Hello, Utilo! is thirteen characters, all ASCII, so it is thirteen bytes. Base64 groups six bits, and 13 is not a multiple of three, hence the padding. Changing the comma changes the output from the S that encodes the comma byte. Paste the output into Base64 to text and the original sentence returns, including the comma and the bang. If a decoder tells you the padding is illegal, you lost the equals signs in a form that treated them as special. Copy the whole line.

Not for files

Pasting a binary file into a text box corrupts it. Use image to Base64 for pictures. This page is for passwords you are about to put in a basic-auth header, for small JSON fixtures, and for teaching the alphabet. A secret you encode here is still a secret in the output. The page does not upload the text, and the output is not encryption. Anyone can decode it.

Frequently asked questions

Is this encryption?

No. Base64 is reversible by anyone. Do not use it to hide a secret.

How are emoji handled?

As UTF-8 bytes, the same way a server encodes a JSON string.

Why the equals signs?

Padding so the length is a multiple of four. Keep them unless the receiver uses a padding-optional decoder.

Is the text uploaded?

No. Encoding runs locally.