How to Encode and Decode Base64 Online (Free)
Base64 is a way to represent binary data (or any text) using only the 64 printable ASCII characters. It's used everywhere: embedding images in HTML, sending binary data through JSON APIs, encoding credentials in HTTP Basic Auth headers, and building the payload of JWT tokens. This guide shows you how to encode and decode Base64 in seconds — entirely in your browser.
What Is Base64?
Base64 encodes every 3 bytes of input as 4 ASCII characters from the alphabetA–Z a–z 0–9 + /. The output is padded with = signs to make the length a multiple of 4.
For example, Hello encodes toSGVsbG8=. Base64 is not encryption — anyone can decode it. Its purpose is encoding, not security.
Step-by-Step: Encoding Text to Base64
Open the Base64 Encoder
Go to the Base64 Encoder tool. No account, no install — it runs in your browser.
Paste your text
Paste or type the text you want to encode. This can be a plain sentence, a JSON object, an API key, an HTML snippet, or any UTF-8 text.
Click Encode
The Base64-encoded output appears in the right panel instantly. Unicode characters are handled correctly: the text is first converted to UTF-8 bytes before encoding.
Copy the result
Click Copy to copy the Base64 string to your clipboard. The output is a single line with no line breaks — ready to embed in a header, data URI, or API call.
Step-by-Step: Decoding Base64
To reverse the process and recover the original text:
Paste the Base64 string
Paste the Base64-encoded string into the input panel. It's okay if it ends with = or == padding.
Click Decode
The decoded plain text appears in the output panel. If the Base64 string is invalid (wrong characters, wrong length), you'll see a clear error message.
Copy your decoded text
Click Copy to copy the result.
Standard Base64 vs. URL-Safe Base64
Standard Base64 uses + and/ as the two special characters. These have special meaning in URLs, which is why JWT tokens and data URLs use URL-safe Base64: the same alphabet but with -replacing + and_ replacing/, often with no padding.
If you're decoding a JWT segment and see hyphens and underscores, you're working with URL-safe Base64. The decoder handles this automatically.