Minifyr

Privacy-first tool

Base64 Encoder / Decoder

Encode text to Base64 or decode Base64 back to UTF-8, with optional URL-safe output. Everything runs locally.

Runs locally No uploads Privacy-first

Result


        

Related tools

More privacy-first utilities you may find useful.

Guides

Learn more about this topic.

Frequently asked questions

Does it support Unicode text?

Yes. Text is encoded as UTF-8 before Base64 encoding and decoded back to UTF-8.

What is URL-safe Base64?

It replaces + and / with - and _ and removes padding so the value can be used in URLs.

Is Base64 encryption?

No. Base64 is an encoding, not encryption. Anyone can decode it.

Why does decoded text look broken?

The Base64 value may represent binary data or bytes that are not valid UTF-8. This tool is intended for text payloads.

Is Base64 case-sensitive?

Yes. Uppercase and lowercase letters represent different values, so copy the encoded string exactly.

Can I encode images or files with this tool?

This tool is designed for text. Base64 can represent binary files, but this page focuses on UTF-8 text and will not display binary output.

What Is Base64?

Base64 is a way to represent binary data using only printable ASCII characters. It is used when a system needs to carry bytes through a text-only channel, such as a JSON field, an email header, a URL or an authentication header. The encoding is reversible: anyone with the Base64 value can decode it back to the original bytes.

This tool encodes UTF-8 text to Base64 and decodes Base64 back to UTF-8 text. It supports standard and URL-safe Base64, and it runs entirely in your browser.

How to Encode or Decode Base64

  1. Paste the text you want to encode, or the Base64 value you want to decode.
  2. Select Encode or Decode.
  3. Enable URL-safe if the value will be placed in a URL or filename.
  4. Copy or download the result.

Encoding is live: the result updates as you type. If decoding fails, the input is not valid Base64 or does not represent valid UTF-8 text. Check padding, URL-safe characters and whitespace first.

UTF-8 and URL-safe Base64

Standard Base64 uses +, / and =. In URLs and filenames those characters can be awkward, so URL-safe Base64 replaces + with - and / with _, and often removes the trailing padding. When decoding, this tool normalizes URL-safe input and restores missing padding automatically.

Text is encoded as UTF-8 before Base64 conversion. That means accented letters, emoji and non-Latin scripts round-trip correctly when the original data is valid UTF-8. Binary data that is not valid UTF-8 cannot be displayed as text and will produce a decoding error.

Common Uses

  • Embedding small text values in JSON or configuration files.
  • Building HTTP Basic authentication headers during development.
  • Inspecting JWT segments and other token payloads.
  • Passing data through systems that only accept ASCII text.
  • Debugging API requests that contain encoded values.

Base64 Is Not Encryption

Base64 provides encoding, not security. It does not protect secrets, verify integrity or hide data from anyone who has the value. If you need confidentiality, use proper encryption and key management. If you need a one-way fingerprint, use a hash function instead.

Base64 vs URL Encoding

Base64 and URL encoding are often confused because both turn data into text, but they solve different problems. URL encoding (percent-encoding) escapes characters that are reserved in URLs, such as spaces, ampersands and question marks. Base64 represents arbitrary bytes using a larger alphabet. Use URL encoding for query values and path segments; use Base64 when a protocol expects it or when a text-only channel must carry binary data. Neither one is encryption, and neither should be used to protect secrets.

Troubleshooting Invalid Base64

Missing padding

Standard Base64 length is a multiple of four, padded with =. Some systems omit padding; the decoder restores it automatically, but malformed input can still fail.

URL-safe characters

If the value contains - or _, it is likely URL-safe Base64. Enable the URL-safe option or let the decoder normalize it. Mixing standard and URL-safe characters usually means the value was copied incorrectly.

Whitespace and line breaks

Line breaks and spaces are usually ignored by Base64 decoders, but stray characters from copied text can still cause errors. Remove them and try again.

Binary or non-UTF-8 payloads

A Base64 value can represent an image, a compressed file or encrypted bytes. Those payloads are not text, so decoding them as UTF-8 will fail or produce unreadable output. This tool is intended for text values.

Related Tools

Inspect token payloads with the JWT Decoder, format the surrounding payload with the JSON Formatter, or encode URLs and query values with the URL Encoder / Decoder.