Skip to content
PithLab

↑↓ to move · Enter to open · Esc to close

Base64 Encode and Decode Online

Convert text to and from Base64, including URL-safe Base64.

Use via API

Encode text to Base64 or decode Base64 to text (UTF-8). Send JSON, get JSON back.

POST https://pithlab.com/api/v1/tools/base64-encoder-decoder

curl https://pithlab.com/api/v1/tools/base64-encoder-decoder \
  -H "Authorization: Bearer $PITHLAB_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":"Hello, World!","mode":"encode"}'

Fields and responseOpenAPI documentGet an API key

About the Base64 Encoder/Decoder

Encode text to Base64 or decode Base64 back to text, with full UTF-8 and URL-safe Base64 support. Runs in your browser, so nothing is uploaded.

How to use the Base64 Encoder/Decoder

  1. Choose Encode to turn text into Base64, or Decode to turn Base64 back into text.
  2. Paste your input. The result updates as you type.
  3. When encoding, tick URL-safe to use - and _ instead of + and / and drop the = padding.
  4. When decoding, standard and URL-safe input are both accepted, with or without padding.
  5. Use Swap to feed the output back in as input.

Examples

Encode a greeting

Input

Hello, World!

Output

SGVsbG8sIFdvcmxkIQ==
Encode text with an emoji

Input

café ☕

Output

Y2Fmw6kg4piV
Decode URL-safe Base64

Input

8J-agA

Output

🚀

Frequently asked questions

Is Base64 encryption?

No. Base64 is an encoding that represents bytes using 64 printable characters. Anyone can decode it, so it should never be used to protect secrets.

What is URL-safe Base64?

URL-safe Base64 (RFC 4648 §5, often called base64url) replaces + with - and / with _ so the result can be used in URLs and filenames. It is used in JWTs and many web APIs.

Why does decoding fail with a binary data message?

The Base64 decoded successfully, but the bytes are not valid UTF-8 text, for example because they are an image or a compressed file. This tool only displays text.

Why does Base64 make data bigger?

Every 3 bytes of input become 4 Base64 characters, so encoded data is about 33% larger than the original.

Guides that use this tool

  • How to read a JWT without leaking it

    A JSON Web Token is just three Base64url chunks. Here's how to read the header and claims, what to check, and why you should never paste one into a random site.