Skip to main content
CaseSwitch

Base64 Encode & Decode

Encode UTF-8 text to the standard Base64 alphabet (A–Z, a–z, 0–9, +, / with = padding), or decode Base64 back to readable text. Choose Encode or Decode, paste the value, and copy the result. This is not encryption and not URL-safe Base64 (-_). Processing stays in this browser.

Written by the CaseSwitch editorial team. We maintain these tools in the browser so drafts, keys, and images stay on your device.

Last reviewed: 23 July 2026

Processed locally in your browser. Nothing is sent to a server.

Paste or type text to convert. Output stays empty until there is input.

Character count: 0 · Word count: 0 · Line count: 0

Examples

Encode CaseSwitch

Input

CaseSwitch

Output

Q2FzZVN3aXRjaA==

Decode CaseSwitch

Input

Q2FzZVN3aXRjaA==

Output

CaseSwitch

Encode UTF-8 (café)

Input

café

Output

Y2Fmw6k=

Decode UTF-8 (café)

Input

Y2Fmw6k=

Output

café

Not encryption — anyone can decode

Input

CaseSwitch

Output

Q2FzZVN3aXRjaA== (readable again after Decode — Base64 hides nothing)

How to use

  1. Choose Encode to produce Base64, or Decode to recover text.
  2. Paste the text or Base64 string into the input panel.
  3. Copy the output. For a round-trip check, encode once, then switch to Decode and paste the Base64 back.

What this tool is for

Base64 turns arbitrary bytes into an ASCII alphabet (A–Z, a–z, 0–9, +, / with = padding) so binary or awkward text can travel through JSON, email, or data URLs. This page encodes and decodes UTF-8 text locally — useful for tokens, small payloads, and clipboard experiments. Encoding is reversible and visible to anyone; it is not encryption, hashing, or access control.

How it works

Encode mode UTF-8–encodes your text, then maps those bytes to the standard Base64 alphabet with padding. Decode mode reverses that: it reads Base64, rebuilds the bytes, and decodes them as UTF-8 text. Invalid Base64 fails with an error rather than a guessed string. Whitespace on decode input should be trimmed; URL-safe Base64 that uses - and _ is not the same alphabet as this standard decoder.

When to use it

Embedding a small SVG or icon in a data URL experiment, inspecting the readable middle of a JWT (still not verifying the signature here), converting clipboard text for an API field that expects Base64, and teaching the difference between encoding and encryption with a live round-trip.

When not to use it

Do not treat Base64 as confidentiality — anyone can decode it. Do not dump multi-megabyte files if the tab struggles; use a local script for bulk binary. Image format conversion belongs on the image tools. Password storage needs a password hash, not Base64. Signature verification needs a crypto library, not this page.

How it compares to related tools

URL Encode & Decode percent-encodes for query strings (a different alphabet). UTF-8 Encoder & Decoder shows code units without Base64. MD5 Hash Generator is one-way and not reversible. Hex is another binary-as-text format. Longer background: Base64 encoding explained.

Common mistakes

Pasting a JWT and thinking the payload is verified. Mixing URL-safe Base64 (-_) with standard (+/) without converting. Wrapping lines when the consumer wants a single line. Storing passwords as Base64 and calling it “encryption.” Assuming decode will silently fix missing padding or corrupt input — this tool reports failure instead.

Encoding is not encryption

Base64 is a reversible mapping. If you can encode CaseSwitch to Q2FzZVN3aXRjaA==, anyone else can decode that string back to CaseSwitch with this page or a one-line script. Use TLS in transit and a real crypto library (or your platform’s secret store) for confidentiality. Prefer password hashing for credentials. Treat Base64 as packaging for transport formats, not as a lock.

UTF-8, padding, and URL-safe variants

Text is encoded as UTF-8 before Base64, so café round-trips as Y2Fmw6k= rather than breaking on the accented character. Standard Base64 may end with = or == padding so the length is a multiple of four. Some APIs use URL-safe Base64 that replaces + and / with - and _; this tool expects the standard alphabet. Trim whitespace before decode, and match the variant your producer used.

Frequently asked questions

Is Base64 encryption?+

No. It is a reversible encoding. Anyone with the string can decode it. Use TLS and a real crypto library for secrets.

Why does decode fail?+

Whitespace, missing or wrong padding, corrupted characters, or URL-safe characters (-_) fed to a standard decoder. Trim the string and match the alphabet the producer used.

Does this support Unicode / UTF-8?+

Yes. Encode uses UTF-8 bytes, so characters like café round-trip when you decode the Base64 again.

What about URL-safe Base64?+

URL-safe variants use - and _ instead of + and /. This page uses the standard alphabet. Convert or swap characters if your API requires the URL-safe form.

Can I decode a JWT here?+

You can Base64-decode segments to inspect bytes or text, but this tool does not verify signatures. Do not treat a decoded payload as trusted input.

Is my text uploaded?+

No. Encode and decode run in this browser. Still, do not paste production secrets into a screenshot.

Does this tool send my payload to CaseSwitch?+

No. Formatting, encoding, and naming conversions for this page run in your browser after load — your sample stays on the device.

Related guides

Read our original articles on this topic.

Related tools