Base64 Decoder and Encoder

Paste Base64 to decode it into readable text, or type text to encode it. The tool detects which one you entered, handles UTF-8 and the URL-safe alphabet, and never sends your data anywhere.

Hello, World!

Handles UTF-8 text, the URL-safe alphabet, missing = padding and data: URLs. Everything runs in your browser.

How to use the Base64 decoder

  1. Paste a Base64 string to decode it, or type normal text to encode it. Auto-detect picks the direction for you.
  2. For encoding, tick URL-safe if the result will go in a URL or a token.
  3. Copy the result, or press Swap to convert it back and check it.

What is Base64?

Base64 is a way to write any data, including binary files, using only 64 safe characters: A–Z, a–z, 0–9, + and /. It exists because many systems, such as email and older web protocols, were designed for plain text and could corrupt raw binary data. Encoding the data as Base64 lets it travel through those systems unchanged.

How Base64 encoding works

The encoder takes the input three bytes (24 bits) at a time and splits them into four groups of 6 bits. Each 6-bit number, from 0 to 63, picks one character from the Base64 alphabet. For example, the word Man:

StepMan
ASCII7797110
Bits010011010110000101101110

Regrouped into 6-bit chunks this gives 010011 010110 000101 101110 = 19, 22, 5, 46, which are the characters T W F u. So Man becomes TWFu. Because 3 bytes become 4 characters, Base64 makes data about 33% larger.

Examples

TextBase64
HelloSGVsbG8=
Hello, World!SGVsbG8sIFdvcmxkIQ==
user:passworddXNlcjpwYXNzd29yZA==
caféY2Fmw6k=

Where you will see Base64

  • Email attachments, which are sent as Base64 inside the message.
  • Data URLs such as data:image/png;base64,… that embed small images in web pages.
  • JSON Web Tokens used for logins, whose header and payload are URL-safe Base64.
  • HTTP Basic authentication, which sends user:password as Base64. That is why it must only be used over HTTPS.

Frequently asked questions

Is Base64 encryption?

No. Base64 is an encoding, not encryption. Anyone can decode it without a key, so never use it to hide passwords or private data.

Why does Base64 end with = or ==?

Base64 turns every 3 bytes into 4 characters. When the input length is not a multiple of 3, one or two = signs pad the output to a multiple of 4. This decoder also accepts strings where the padding was removed.

What is URL-safe Base64?

A variant that replaces + with - and / with _ and usually drops the = padding, so the result can be used in web addresses and file names. It is used in JSON Web Tokens (JWTs). This tool decodes both versions automatically.

How do I decode a JWT?

A JWT has three parts separated by dots. The first two (header and payload) are URL-safe Base64. Paste one part at a time to read it. The third part is a signature and is not readable text.

Why does the decoded result look like gibberish?

The Base64 probably holds a file, such as an image or PDF, rather than text. The tool warns you when the decoded bytes are not valid text.

Is my data uploaded?

No. Encoding and decoding happen in your browser, which makes the tool safe for tokens and configuration values.

More free tools