Base64 Encode / Decode
Convert text to Base64, or decode a Base64 string back to plain text.
How this Base64 tool works
Base64 turns arbitrary bytes into a text-safe string using 64 printable characters, which is why it's used to embed binary data (like images) inside text formats (like JSON, XML, or email). Encoding and decoding both happen locally using the browser's built-in btoa/atob functions, so nothing you type ever leaves your device.
Standard vs. URL-safe Base64
Standard Base64 uses + and / as two of its 64 characters, plus = padding at the end. That's a problem in URLs and filenames, where + and / have special meaning — so a variant called Base64URL swaps them for - and _, and often drops the padding entirely. JWTs specifically use Base64URL without padding. If you paste a JWT segment here and get a decode error, that's almost always why.
Multi-byte text and encoding gotchas
Base64 encodes bytes, not characters, so encoding non-ASCII text (accented letters, emoji, CJK characters) requires first converting the string to UTF-8 bytes. Naively calling btoa() directly on a string with non-Latin1 characters throws an error in most browsers — this tool handles that conversion for you, but it's a common source of bugs if you're writing your own encoder.
Frequently asked questions
Why do I get an error decoding a JWT segment here?
JWTs use Base64URL encoding (with -/_ instead of +//, and no padding), which differs slightly from standard Base64. Use the dedicated JWT Decoder tool instead, which handles that variant automatically.
What's the difference between Base64 and encryption?
None, in terms of secrecy. Base64 is an encoding, not encryption — anyone can decode it instantly with no key. Never rely on Base64 alone to protect sensitive data.
Can this encode files, or just text?
This version accepts pasted text. For encoding files (images, PDFs, etc.) into Base64 data URIs, you'd need a file-upload variant, since a paste box can't hold raw binary file data directly.