Base64 Encode Decode Online - Free Converter

Base64 Encode / Decode

Encode and decode text to/from Base64. Supports UTF-8 and URL-safe variants.

Use this Base64 encode decode tool to turn plain text into Base64 or convert a Base64 string back into readable text. It supports UTF-8 characters, URL-safe output and optional padding removal, and it shows the result instantly. Developers, testers and SEO specialists can use it to inspect or prepare encoded data in seconds.

What Is Base64 Encoding and Decoding?

Base64 is a way to represent data using only 64 safe text characters: A to Z, a to z, 0 to 9, plus the symbols + and /. Encoding converts the original bytes into that text form. Decoding reverses the process and returns the original bytes.

The conversion works in groups. Every 3 bytes of input become 4 Base64 characters, so encoded data is about one third larger than the original. When the input length is not a multiple of 3, the output ends with one or two = signs. These are called padding characters.

Base64 is an encoding, not encryption. Anyone can decode it, and it adds no secrecy. Its job is to let data travel through systems that only handle plain text, such as email bodies, JSON fields, HTML attributes and HTTP headers.

Standard vs. URL-safe Base64

Standard Base64 uses + and /, which have special meanings in web addresses. The URL-safe variant swaps them for - and _ so the string can sit in a query parameter or a file name without extra escaping. Many tokens you see in web apps use this variant, often without the trailing = padding.

How to Use the Base64 Encoder and Decoder

You can encode or decode text in a few clicks. The tool starts in Encode mode, and the same box and buttons handle both directions.

  1. Pick a mode with the Encode or Decode button at the top. The input label changes between "Plain text" and "Base64" so you always know what to paste.
  2. Type or paste your content into the input box. In Encode mode the hint reads "Enter text to encode..." and in Decode mode it reads "Paste Base64 to decode...".
  3. For encoding, tick URL-safe (use - and _ instead of + and /) if the result will go into a URL, a cookie or a file name.
  4. Tick No padding if you want the trailing = characters removed from the encoded result.
  5. Click the main Encode or Decode button. The result appears in the output box, labeled "Base64 output" or "Decoded text", with a status line underneath.
  6. Click Copy to put the result on your clipboard, or click Use output as input to move the result into the input box for another round.

The two checkboxes only change encoded output. When you decode, the tool accepts standard and URL-safe strings alike, ignores spaces and line breaks, and adds any missing padding for you.

Worked Example: Encoding and Decoding Real Strings

A quick example shows exactly what to expect. Enter Hello, World! in Encode mode and click Encode. The output is SGVsbG8sIFdvcmxkIQ==, and the status line reads "Encoded 13 characters." The two = signs appear because 13 bytes do not divide evenly by 3.

Now tick No padding and encode again. You get SGVsbG8sIFdvcmxkIQ, the same string without the trailing signs. Paste that shorter version into Decode mode and you still get Hello, World! back, because the tool restores the padding before decoding.

A URL-safe example

Encode the six characters >>>??? with default settings and you get Pj4+Pz8/. Tick URL-safe and the result becomes Pj4-Pz8_. Both strings decode to the same text. The only difference is that the second one can be placed in a link without percent-encoding.

A non-English example

The word café contains an accented letter that takes two bytes in UTF-8. The tool encodes it as Y2Fmw6k=, and decoding that string returns café intact. This is why emoji, accented letters and non-Latin scripts survive a round trip.

How to Read and Act on the Results

The output box and the status line tell you whether the conversion worked. A green message such as "Decoded successfully." means the text is ready to copy. A red message starting with "Error:" means the input could not be converted, and the output box is left empty.

What you seeWhat it meansWhat to do
Output ends in = or ==Standard padding was addedKeep it for most APIs and email
Output has - and _URL-safe variantUse it in URLs and tokens
Error messageInput is not valid Base64 or not valid textCheck for stray characters

Do a round-trip check

To confirm your data is intact, encode it, click Use output as input, switch to Decode and click Decode. If the final text matches your original, the encoding is correct. This takes about ten seconds and catches copy and paste mistakes before they reach production.

Estimate the size increase

Because 3 bytes become 4 characters, a 300-byte string becomes about 400 characters. Keep this in mind when embedding data in a header, cookie or configuration field that has a length limit.

Who Uses a Base64 Converter, and When?

Anyone who moves data between systems eventually meets Base64, and a quick converter saves a trip to the command line. Here are the situations where it helps most.

  • Debugging API credentials: HTTP Basic authentication joins a username and password with a colon and encodes the pair. Encoding user:pass gives dXNlcjpwYXNz, which you can compare with what your code sends.
  • Reading tokens and config values: Many settings files and web tokens store text as Base64. Paste the value in Decode mode to read it. If the result is JSON, run it through a code beautifier to make it easy to scan.
  • Checking code output: If you wrote Base64 logic in Python, JavaScript, Java, PHP or a Linux shell, paste the same input here and compare results. A mismatch usually points to an encoding or newline difference.
  • Comparing two encoded values: Decode both and use a code diff tool to see exactly which lines changed.
  • Preparing text for URLs: When a value must live in a query string, URL-safe output avoids characters that browsers and servers treat specially.

If you work on server rules or headers, these related utilities often come up in the same session: the htaccess redirect generator and the CORS header generator. You can find more in the web developer tools collection.

Best Practices, Common Mistakes and Troubleshooting

Most Base64 problems come from the input, not the conversion. These are the cases people hit most often, with the fix for each.

The decoder shows an error

An error means the input contains characters that Base64 does not allow, or the decoded bytes are not valid UTF-8 text. Look for stray quotes, commas, brackets or a leading label such as Basic in front of the value. Remove them and try again.

You pasted a data URI

Image strings often look like data:image/png;base64,iVBOR.... Only the part after the comma is Base64. Delete the prefix before decoding, or the colon and comma will trigger an error.

The Base64 represents a file, not text

If the string is an image, PDF or other binary file, the bytes are not readable text, so Decode mode will report an error instead of showing content. This tool is built for text in and text out.

The string has line breaks

Email and some command-line output wrap Base64 at fixed line lengths. You can paste the wrapped version as is, because spaces and line breaks are ignored when decoding.

The decoded text looks wrong

If the original was written in a legacy character set rather than UTF-8, the decode may fail or show unexpected symbols. Ask the sender which character set they used, or re-encode the source as UTF-8 and try again.

General habits that prevent trouble

  • Match the variant to the destination. Use URL-safe for links and tokens, standard for most email and legacy systems.
  • Do not store secrets in Base64 and assume they are hidden. Treat it as readable by anyone.
  • Keep the padding unless the receiving system says to drop it. Some strict parsers reject unpadded input.
  • Check the character count in the status line when encoding. A count that differs from what you expect often reveals a hidden trailing space or line break.

Limitations to Keep in Mind

This tool converts text to Base64 and back. It does not upload or convert files, and it does not decrypt anything. Decoding returns readable text only when the original data was valid UTF-8 text.

The status line shows a character count when you encode, which counts characters, not bytes. A string with accented letters or emoji will produce more Base64 than its character count suggests, because those characters use two to four bytes each.

Ready to convert something? Choose Encode or Decode above, paste your text, set the URL-safe and No padding options if you need them, and copy the result. If you are chasing a bug, run a round-trip check first, then compare the output with your code.

Frequently Asked Questions

What is Base64 encode decode used for?
Base64 encoding turns data into plain text characters so it can travel safely through text-only systems. Common uses include API credentials, email content, tokens, config values and embedded images. Decoding returns the original text, which is handy for debugging.
How do I decode a Base64 encoded string online?
Click Decode, paste your Base64 string into the input box, then click the Decode button. The readable text appears in the Decoded text box. Spaces and line breaks are ignored, and missing padding is added automatically.
What is the difference between standard and URL-safe Base64?
Standard Base64 uses plus and slash characters, while URL-safe Base64 uses hyphen and underscore instead. For example, Pj4+Pz8/ becomes Pj4-Pz8_. Choose the URL-safe option when the result will be placed in a link, cookie or file name.
Can this Base64 tool handle emoji and non-English characters?
Yes, the tool handles UTF-8 text, including emoji, accented letters and non-Latin scripts. For example, the word café encodes to Y2Fmw6k= and decodes back to café. Decoding works as long as the original data was UTF-8 text.
Why does my Base64 decode show an error?
An error usually means the input has characters Base64 does not allow, or the decoded bytes are not valid UTF-8 text. Remove prefixes such as data:image/png;base64, quotes or labels, then try again. Binary files will not decode to readable text.
Is Base64 encryption, and is this tool free?
No, Base64 is an encoding that anyone can reverse, so never rely on it to protect secrets. This Base64 encoder and decoder is free to use and does not require you to sign in.
Recommended

Explore VPN options

A VPN changes your network exit. It does not guarantee anonymity.

Hide Your IP Encryption Network coverage
Protect My IP Now