Base64 Encoder / Decoder
TextEncoder API.Overview
Encode and decode Base64 — Standard and URL-safe — in your browser
Paste Base64 to decode it back to text, or type text to encode it — the result updates as you type. The Standard and URL-safe variants are both supported and detected automatically on decode, a live character and byte counter tracks your input, and invalid Base64 is reported with the exact character and position.
Guide
How to Use
- 1 Choose a direction
Pick the Encode tab to turn text into Base64, or the Decode tab to turn Base64 back into readable text.
- 2 Select a variant
Choose Standard (uses + and /) or URL-safe (uses - and _, no padding). When decoding, the variant is detected for you, so most of the time you can leave it alone.
- 3 Enter your input
Type, paste, or use the Paste button to pull text from your clipboard. The result updates as you type — no button to press.
- 4 Copy or swap the result
Click Copy to put the result on your clipboard. Use Swap to send the output back into the input and convert in the opposite direction — handy for verifying a round-trip.
Reference
Standard vs URL-safe Base64
| Variant | Extra characters | Padding | Typical use |
|---|---|---|---|
| Standard | + and / | Kept (=) | Data URIs, email/MIME |
| URL-safe | - and _ | Omitted | URLs, filenames, JWT |
Pitfalls
Common Mistakes
-
Decoding a full JWT at once
A JWT has three dot-separated segments. Pasting the whole token decodes only the header. To read the payload, copy the segment between the two dots and decode it on its own.
-
Mixing the two alphabets
A single string cannot contain both +/ and -_. If a string mixes them it is not valid Base64 — it was likely corrupted by a partial find-and-replace. Re-export it from the original source.
-
Expecting Base64 to be encryption
Base64 is an encoding, not encryption. Anyone can decode it. Never use it to hide passwords or secrets — it only makes binary data safe to carry as text.
-
Treating decoded binary as text
Base64 can carry any bytes, including images and compressed data. Decoding such input produces unreadable characters because it is not text at all. This tool decodes to UTF-8 text.