Base64 Encode / Decode

Encode text to Base64 or decode Base64 back to plain text.

Input data is processed in your browser
Data is never sent to a server

Tool

0 chars

or drag & drop a file

0 chars

What is Base64?

Base64 is an encoding scheme that converts binary data or text into an ASCII string. It is widely used for email attachments, data URIs, and API data transfer.

When this comes in handy

  • You need to Base64-encode API keys or Basic Auth credentials: to build an Authorization: Basic <base64> header by hand, just enter the text in username:password form and encode it.
  • You want to decode a JWT or cookie value to see what’s inside: paste in the Base64-encoded string and decode it to reveal the original text (for parsing a JWT’s structure, see JWT Decoder as well).
  • You need to Base64-encode text that includes non-ASCII characters: MIME-encoded email subject lines and some API formats require Base64 for non-ASCII text, and this lets you confirm it’s encoded and decoded correctly as UTF-8.
  • You’re prototyping something that embeds binary data as text: try a short string first to see what Base64 output looks like before wiring up something like a data URI scheme.

Usage examples

Example 1: Encoding an ASCII string

Input:

Hello, Torinoa Tools!

Output (encoded):

SGVsbG8sIFRvcmlub2EgVG9vbHMh

Example 2: Encoding a string with non-ASCII characters

Input:

こんにちは

Output (encoded):

44GT44KT44Gr44Gh44Gv

Internally, the text is first converted to a UTF-8 byte sequence and then Base64-encoded, so strings containing Japanese, emoji, or other non-ASCII characters round-trip correctly (encode, then decode back to the original).

Example 3: Decoding a Base64 string

The reverse direction works on the same screen.

Input:

SGVsbG8sIFRvcmlub2EgVG9vbHMh

Output (decoded):

Hello, Torinoa Tools!

Example 4: Entering an invalid Base64 string

Input:

not-valid-base64@@@

@ isn’t a valid Base64 character, so trying to decode this produces an error:

Error: Invalid Base64 string. Please check your input.

The same error shows up if characters were accidentally dropped while copying, or if extra symbols or line breaks got mixed in. Double-check the contents of the input field.

How to Use

  1. Enter the text you want to convert in the input field.
  2. Click "Encode" or "Decode".
  3. The result appears in the output field.
  4. Click "Copy Result" to copy to clipboard.

FAQ

Is this tool free?

Yes, it is completely free to use.

Is my data sent to a server?

No. All processing happens in your browser. Nothing is sent to a server.

Does it support Japanese and Unicode characters?

Yes. It supports Unicode strings including Japanese. The input is encoded as UTF-8 internally.

What characters does the encoded output use?

Standard Base64 uses the 64 characters A-Z, a-z, 0-9, +, and /, plus "=" for padding at the end. If you need to use the result directly in a URL or filename, you'll need to convert it separately to URL-safe Base64 (replacing + with - and / with _).

Why do I see "Invalid Base64 string" when decoding?

This error appears when the input contains characters that aren't valid in Base64 (symbols other than the standard set), or when the string length isn't a multiple of 4 (broken padding). Check whether any characters were dropped when you copied the text.