07 / Encoding / base64

Base64 Encoder / Decoder

Encode and decode Base64 strings.

ReadyLocal processing
07 · Workspace

How to use

  1. 01Paste or type the text you want to convert into the Input editor.
  2. 02Press Encode to turn the text into Base64, or Decode to turn a Base64 string back into readable text.
  3. 03Tick URL-safe before encoding to get Base64URL output: + becomes -, / becomes _, and trailing = padding is removed.
  4. 04Read the result in the Output panel, which also shows its length in characters.
  5. 05Press Swap to move the output back into the input, for example to decode what you just encoded.
  6. 06Press Copy to put the result on your clipboard.

What is this tool?

This Base64 encoder and decoder converts text to Base64 and back, treating your input as UTF-8 so accented letters, symbols and emoji round-trip correctly. It can produce URL-safe Base64URL output, and the decoder accepts both standard and URL-safe strings, adding missing padding for you. Encoding and decoding run entirely in your browser, so tokens and payloads are never uploaded.

How Base64 encoding works

Base64 represents binary data using 64 printable ASCII characters: A-Z, a-z, 0-9, + and /. The encoder takes the input three bytes (24 bits) at a time and splits them into four 6-bit groups, each of which maps to one character of the alphabet. That is why Base64 output is always about 33% larger than the input.

A classic worked example is the word "Man". Its bytes are 77, 97 and 110; regrouped into 6-bit chunks they give the indexes 19, 22, 5 and 46, which map to "TWFu". When the input is not a multiple of three bytes, the output is padded with =: "Ma" encodes to "TWE=" and "M" encodes to "TQ==".

Text is first converted to UTF-8 bytes, so a character outside ASCII takes more than one byte. For example "é" is two bytes in UTF-8 and encodes to "w6k=".

Base64 vs Base64URL

Standard Base64 uses + and /, which have special meaning in URLs and file paths, and = padding, which must be escaped in query strings. Base64URL (defined in RFC 4648) swaps + for - and / for _, and usually drops the padding. JSON Web Tokens, many OAuth parameters and signed URLs use Base64URL.

For example, the text "<<???>>" encodes to "PDw/Pz8+Pg==" in standard Base64 and to "PDw_Pz8-Pg" with the URL-safe option enabled. When decoding, this tool converts - and _ back and restores the padding automatically, so you can paste either form without changing any setting.

Base64 is encoding, not encryption

Base64 has no key and no secret: anyone can reverse it in one step. It exists to move binary data safely through systems that expect text, such as JSON bodies, email, data URIs and HTTP Basic Auth headers. Never treat a Base64 value as protected; if it contains a password or token, the secret is fully readable to anyone who sees it.

Common use cases

  • Decoding a Basic Auth header to check which username and password a client is sending
  • Inspecting a Base64URL segment of a JWT or a signed URL parameter
  • Encoding a JSON snippet or config value to embed in an environment variable or Kubernetes Secret
  • Verifying that an API returns correctly encoded fields in a test assertion
  • Round-tripping non-ASCII test strings to confirm UTF-8 handling end to end

FAQ

How do I decode Base64?

Paste the Base64 string into the Input editor and press Decode. The decoded text appears in the Output panel, ready to copy.

Is Base64 encryption?

No. Base64 is a reversible encoding with no key, so anyone can decode it. Use real encryption if the data must stay secret.

Why does Base64 end with = or ==?

The = characters are padding. They appear when the input length is not a multiple of three bytes, so the output length stays a multiple of four characters.

Can I decode URL-safe Base64 (Base64URL)?

Yes. The decoder converts - and _ back to + and / and adds any missing padding, so URL-safe strings decode without extra steps.

Why do I get "Input is not valid Base64"?

The input contains characters outside the Base64 alphabet or has an impossible length. Check for stray quotes, a prefix such as "Basic " or "data:...;base64,", or a truncated value.

Is my data uploaded anywhere?

No. Encoding and decoding happen locally in your browser.