Base64 Encode / Decode
Decode Base64 to text or encode text to Base64 online, with full UTF-8 and URL-safe Base64 support. Conversion runs in your browser, so nothing is uploaded.
Runs in your browser · Nothing uploadedFree · No sign-up
Something not working, or missing a feature? Send feedback
About the Base64 Encode / Decode
Base64 represents binary data with 64 printable characters so it can travel through text-only channels such as JSON, URLs and email. Use it to Base64 decode a string back to text or encode text to Base64, with full UTF-8 support.
Everything runs in your browser, so your input is never uploaded to a server.
How to use the Base64 Encode / Decode
- Choose Encode or Decode.
- Paste your text or Base64 string.
- Turn on URL-safe (Base64URL) for tokens and URLs, then copy the result.
Examples
Input
Hello, world!
Result
SGVsbG8sIHdvcmxkIQ==
The == padding makes the length a multiple of 4.
Input
café
Result
Y2Fmw6k=
Text is encoded as UTF-8 first, so accents, other scripts and emoji round-trip correctly.
Common mistakes
- Base64 vs Base64URL. Standard Base64 uses + and /, which break URLs. JWTs and URL parameters use Base64URL with - and _ instead. Turn on URL-safe when decoding a JWT part.
- Missing padding. Base64URL usually drops the trailing = characters. If a strict decoder rejects a value, add = until the length is a multiple of 4.
- Line breaks in the input. Email (MIME) and PEM files wrap Base64 every 64 or 76 characters. Remove the line breaks and any -----BEGIN----- headers before decoding.
- It is not encryption. Anyone can decode Base64. Never use it to hide passwords or API keys.
Works well with the Base64 Encode / Decode
- JWT Decoder & Verifier: decode all three Base64URL parts of a token at once.
- URL Encode / Decode: percent-encode values for query strings instead.
- Hash Generator: create SHA-256 hashes and HMACs of text.
Frequently asked questions
What is Base64URL?
A variant that uses - and _ instead of + and / and usually drops = padding, so the value is safe in URLs and file names. JWTs use it.
Is Base64 encryption?
No. Anyone can decode Base64; it is an encoding, not a way to protect data.
Why is Base64 about 33% larger?
Every 3 bytes of input become 4 printable characters, so encoded data is roughly a third larger than the original.
How do I decode Base64 in JavaScript?
atob() and btoa() handle only Latin-1 text. For UTF-8, use TextEncoder and TextDecoder with the bytes, or Uint8Array.fromBase64 in newer browsers.
Guides and tutorials
- Security & Encoding
What Is Base64 Encoding? How It Works and When to Use It
How Base64 turns bytes into text, why it adds 33% to the size, Base64 vs Base64URL, handling UTF-8 in JavaScript, and why Base64 is never encryption.
· 7 min read
- Security & Encoding
URL Encoding Explained: Percent-Encoding, encodeURIComponent and Common Bugs
How percent-encoding works, when to use encodeURIComponent vs encodeURI, why + sometimes means a space, and how to fix double encoding and broken query strings.
· 6 min read
- Security & Encoding
JWT Explained: Structure, Claims and How to Verify a Token
What is inside a JSON Web Token, how the signature works, which claims to check, and the security mistakes (alg none, weak secrets, storage) that break JWTs.
· 6 min read
Related tools
URL Encode / Decode
URL encode or decode text online: percent-encode query string values and full URLs, or turn %20-style escapes back into readable text.
HTML Entity Encode / Decode
Encode special characters as HTML entities or decode entities such as & and < back to text. Escape user content safely before adding it to a page.
JWT Decoder & Verifier
Paste a JWT to decode its header and payload instantly, read exp and iat as dates and verify HS256 signatures. Tokens are decoded locally, never uploaded.
JWT Generator
Create signed JSON Web Tokens online with HS256, HS384 or HS512 from a custom header and payload. Signing happens in your browser; the secret stays local.
Unicode Escape / Unescape
Convert text to \uXXXX Unicode escape sequences and back online, including emoji and astral characters. Handy for JavaScript, JSON and Java strings.
JSON Escape / Unescape
Escape text for use inside a JSON string, or unescape stringified JSON back to readable text. Handles quotes, backslashes, line breaks and Unicode escapes.