Tool workspace

Base64 Encoder / Decoder

Input

Encode text and files to Base64 or decode Base64 data back into readable text or downloadable files. This online Base64 encoder and decoder supports UTF-8 text, URL-safe Base64, optional padding removal, and configurable output line wrapping.

Input

Output

Loading tool

Loading tool

Developer Tools

Base64 Encoder / Decoder

Encode text and files to Base64 or decode Base64 data back into readable text or downloadable files. This online Base64 encoder and decoder supports UTF-8 text, URL-safe Base64, optional padding removal, and configurable output line wrapping.

Convert data as you type, upload or drop a file, and copy or download the result.

Quick guide

How to use

This tool supports both encoding and decoding. You can enter text, paste Base64 data, or upload a file.

Encode text to Base64

Enter or paste your text into the input field.

The tool automatically converts the text into Base64.

Review the encoded result.

Copy the result, download it, or move it back into the input field if you want to convert it in the opposite direction.

The encoder supports UTF-8, so it can handle text containing characters beyond basic English letters, including accented characters and many non-Latin writing systems.

For example:

Encode a file to Base64

You can also convert a file instead of entering text manually.

Upload a file using the file selector or drag and drop it into the tool.

The tool reads the file and converts its contents into Base64.

Copy or download the encoded result.

This is useful when you need a text representation of an image, document, or another binary file.

Decode Base64 to text

Paste the Base64 string into the input field.

The tool automatically attempts to decode it.

If the decoded data is valid UTF-8 text, it displays the readable result.

Copy or download the decoded content.

For example:

Base64 input: SGVsbG8=

Decoded text: Hello

If the decoded content is binary data rather than readable text, the tool identifies it as binary and allows you to download it instead of displaying it as ordinary text.

Details

About this tool

Encode text and files to Base64 or decode Base64 data back into readable text or downloadable files. This online Base64 encoder and decoder supports UTF-8 text, URL-safe Base64, optional padding removal, and configurable output line wrapping.

Convert data as you type, upload or drop a file, and copy or download the result.

What Is Base64?

Base64 is an encoding method that represents binary data using a set of 64 printable characters. It is commonly used when binary information needs to be transferred or stored in systems designed to handle text.

Computers work with binary data, but some formats and communication systems are designed around text. Base64 provides a way to represent that binary data as a text string.

For example, the word Hello can be represented in Base64 as:

Original text: Hello

Base64 encoded: SGVsbG8=

Base64 is not encryption or compression. It does not hide information or reduce file size. Anyone with the encoded value can decode it, so you should never use Base64 alone to protect passwords, private messages, or other sensitive information.

Common Uses of Base64

Base64 is used in several web development and data-processing situations:

APIs: Represent binary information in text-based request or response formats.

Data URLs: Embed images or other resources directly into HTML or CSS.

Email attachments: Represent file content in a format suitable for email message transmission.

Configuration files: Store binary values in text-based configuration formats.

Web development: Transfer or handle file data in applications that work with text-based formats.

Base64 is useful when a system needs binary data represented as text. However, it increases the size of the encoded data, so it is not always the most efficient way to transfer large files.

Base64 Encoding Options

The generator includes additional options for working with different Base64 formats.

Standard and URL-safe Base64

Standard Base64 uses the + and / characters. These characters can cause problems in some URLs and other contexts.

URL-safe Base64 replaces them with:

+ with -

/ with _

This makes the encoded string more suitable for use in URL-related contexts.

URL-safe Base64 is commonly encountered in systems such as JSON Web Tokens (JWTs).

Optional padding removal

Standard Base64 often uses one or two = characters at the end of an encoded string to indicate padding.

For example:

Padded: SGVsbG8=

Without padding: SGVsbG8

Some applications accept Base64 strings without padding. This tool lets you remove optional padding when needed.

Output line wrapping

You can configure line wrapping to insert line breaks into long Base64 output.

This can make encoded data easier to read or fit into formats that expect lines of a particular length. If the receiving application expects a continuous Base64 string, make sure the line breaks are accepted or removed before using the output.

Base64 Encoding vs. Encryption

Base64 and encryption serve different purposes.

Base64 should never be treated as a security mechanism. Encoding a password or confidential document does not prevent someone from reading it.

If you need to protect sensitive information, use an appropriate encryption method rather than Base64 encoding.

Help

Frequently asked questions

What is a Base64 encoder and decoder?

A Base64 encoder converts text or binary data into a text-based Base64 representation. A Base64 decoder converts that representation back into its original data.

How do I convert text to Base64?

Enter or paste your text into the input field. The tool automatically encodes it into Base64, which you can then copy or download.

How do I decode Base64 to text?

Paste a Base64 string into the input field. The tool attempts to decode it and displays readable UTF-8 text when the decoded data is valid text.

Does Base64 support UTF-8 characters?

Yes. This tool supports UTF-8 text, including accented characters and non-Latin characters.

What is URL-safe Base64?

URL-safe Base64 is a variation that replaces + with - and / with _. It is designed to make encoded values more suitable for URLs and related applications.

What does Base64 padding mean?

Padding refers to the = characters sometimes added to the end of a Base64 string. Some applications require padding, while others accept strings without it.

Can I encode files with this tool?

Yes. You can upload or drag and drop a file to encode its contents into Base64. You can copy or download the resulting output.

Why does decoded Base64 sometimes appear as binary data?

Base64 can represent any type of binary data, not just readable text. If the decoded result is not valid UTF-8 text, it may be identified as binary data and offered as a downloadable file.

Is Base64 encryption?

No. Base64 is an encoding format, not encryption. It does not protect information or prevent others from decoding it.

No.