Base64 and Base64URL Text Converter – Free

Paste UTF-8 text to encode it as standard Base64 or Base64URL. When decoding, paste either alphabet and the converter recognizes it automatically.

Open the Base64 workbench for files and line-by-line conversion

How to use the Base64 and Base64URL Text Converter tool

  1. Under Operation, choose Encode to turn text into Base64, or Decode to turn Base64 into text.
  2. Under Encoding alphabet, choose Standard or URL-safe. This setting is used by Encode only.
  3. Type or paste your input into the Text or Base64 box. Select Example to encode Hello, world! with the default settings.
  4. Select Convert and read the output in the Result box.
  5. Select Copy to copy the result, or Clear to reset the form.

How the Base64 encoder and decoder works

Encoding converts your text to UTF-8 bytes and writes them with the alphabet you picked. Standard gives the RFC 4648 section 4 form with +, / and = padding. URL-safe gives the section 5 form: - replaces +, _ replaces /, and the padding is removed.

Decoding is more forgiving about shape. Whitespace is stripped, a data URL prefix is removed, padding may be present or absent, and the alphabet is chosen from the input itself: a - or _ anywhere selects URL-safe. The decoded bytes must be valid UTF-8 to be shown.

One input, both alphabets

The seven-character sample below was picked because its encoding uses both special characters. The standard form ends with two = signs since seven bytes leave one byte in the last group. The URL-safe form swaps two characters and is two characters shorter.

Encode, Standard:  <<???>>     ->  PDw/Pz8+Pg==
Encode, URL-safe:  <<???>>     ->  PDw_Pz8-Pg
Decode:            PDw_Pz8-Pg  ->  <<???>>

Behavior worth knowing

These details come from how the form is implemented and are easy to miss.

  • The Encoding alphabet setting has no effect on Decode.
  • Encode does not trim. A trailing space or line break becomes part of the output.
  • The whole box is one value. There is no line-by-line mode and no line wrapping of the result.
  • An empty box encodes to an empty result. In Decode it gives Enter Base64 data to convert.
  • Decoding binary data fails with the browser's UTF-8 decoding error. Use the Base64 reader for content that is not text.

Standard or URL-safe: which to choose

Pick Standard when the receiver is an email system, a PEM file, an HTTP Basic header, a data URL or a typical JSON API. Those all expect + and / and usually padding.

Pick URL-safe when the value goes into a URL path or query, a file name, or a token format such as JWT. In those places + can be read as a space, / splits path segments and = collides with key=value syntax. If you receive the wrong variant, there is no need to decode and re-encode by hand: this form decodes either one.

Frequently asked questions

What is the difference between standard and URL-safe Base64?

Two characters and the padding. Standard uses + and / and pads with =. URL-safe uses - and _ and, in this tool, omits the padding. The decoded data is identical.

Why does decoding fail on a string that looks valid?

The string may be fine while its content is not text. Images, compressed data and encrypted values are not valid UTF-8, so the text decoder refuses them. Open the value in the Base64 reader to inspect or download the bytes.

Does the tool support Unicode and emoji?

Yes. Text is encoded as UTF-8, so accented letters take two bytes, most CJK characters three and most emoji four. The same UTF-8 rule is applied when decoding.

Can I use Base64 to hide a password?

No. Base64 has no key and anyone can reverse it in seconds. It exists to move bytes through text-only channels. Use encryption or a secrets manager when the value must stay confidential.

Is my text sent to a server?

No. Both operations are done by JavaScript in the page. Your input is never part of a network request, so the form also suits values you would not paste into a remote service.

Related tools