Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 back to text. Runs entirely in your browser.
Wondering what Base64 actually does? Read: Base64 Encoding Explained
Working with JWTs or URLs specifically? Read: Base64 vs. Base64URL
Embedding an image in HTML or CSS? Read: How Data URLs Work
How it works
This tool uses the browser's native btoa()/atob() functions to encode text to Base64 or decode Base64 back to plain text, entirely client-side — nothing you paste is sent to a server.
When you’d use this
- Decoding the header or payload segment of a JWT token to inspect its claims
- Embedding a small image directly in CSS or HTML as a data URL
- Decoding an HTTP Basic Authentication header while debugging an API request
Common questions
Is Base64 the same as encryption?+
No. Base64 is an encoding, not a cipher — it has no secret key, and anyone can reverse it instantly. If you see sensitive data "protected" only by Base64, it isn't protected at all, just represented differently.
Why is the encoded output always longer than the input?+
Base64 represents every 3 bytes of input as 4 characters of output — a fixed ratio that makes the result roughly 33% larger. This is a mechanical property of using only 64 safe characters, not an inefficiency.
Can I encode/decode files, not just text?+
This tool works on text you paste directly. For binary files (images, PDFs), the underlying btoa()/atob() approach works the same way once the file is read as text — a dedicated file-to-Base64 flow would read the file first, then encode its contents.
Why did decoding fail with an error?+
Valid Base64 only contains the characters A-Z, a-z, 0-9, +, /, and = for padding. If your input has line breaks, spaces, or was copied incompletely, decoding will fail — check that you copied the entire, unmodified string.