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
- Choose Encode to produce Base64, or Decode to recover text.
- Paste the text or Base64 string into the input panel.
- 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
UTF-8 Encoder & Decoder
Fixing a file that was read as Latin-1, explaining why a database column “looks wrong,” checking emoji byte length, and teaching that characters are not always one byte.
URL Encode & Decode
Building a query string by hand, debugging why a redirect broke, inspecting logs that show encoded URLs, and teaching the difference between component encoding and full-URI encoding.
JSON Formatter
Debugging a 401 response, comparing two configs, preparing a gist, shrinking a JSON blob before embedding it in a test fixture, and checking whether a file is actually JSON before you commit it. If you need to escape a string as a JSON literal, use JSON Stringify instead. If you need YAML, use JSON to YAML after the JSON is valid.
Hex to Text Converter
Reading a hex dump from a ticket, checking a short ASCII payload, teaching binary/hex alongside the [Binary Code Translator](/binary-code-translator/), and round-tripping a brand string.
Binary Code Translator
Computer science homework, explaining ASCII vs UTF-8, decoding a bitstring from an ASCII-based puzzle, and round-tripping a short word.