Base64 Encoder / Decoder
Developer Tools · By Sidhin · Added
Convert text to Base64 and back. Unlike the browser's built-in btoa, this handles the full Unicode range correctly, so emoji and non-Latin scripts survive the round trip. A URL-safe mode swaps the problematic characters for use in query strings and JWTs.
How to use the base64 encoder / decoder
- 1Choose Encode or Decode.
- 2Paste your text or your Base64 string.
- 3Switch on URL-safe mode if the output will go into a URL or a JWT.
- 4Copy the result — the conversion happens as you type.
Examples
Encoding
- Input
- Hello, world!
- Result
- SGVsbG8sIHdvcmxkIQ==
Unicode round trip
- Input
- こんにちは 👋
- Result
- 44GT44KT44Gr44Gh44GvIPCfkYs= — decodes back to the original exactly
About the base64 encoder / decoder
Where Base64 legitimately belongs
Email attachments, HTTP Basic authentication headers, data URIs for tiny inline assets, binary fields inside JSON, and the payload sections of JSON Web Tokens. The common thread is a channel that only reliably carries text.
It does not belong in a database column that could hold bytes, in a password field, or anywhere the 33 percent size penalty is paid for no reason.
Decoding safely
A Base64 string from an untrusted source is untrusted data after decoding too. Decoding a JWT payload here is a perfectly good way to see what a token claims — but seeing the claims is not the same as verifying the signature, and an unverified token proves nothing.
As a general rule, use this tool to inspect and debug. Never use a decoded value in a security decision without validating it through the proper channel.
Frequently asked questions
Is Base64 encryption?
Why does btoa fail on non-ASCII text?
What is URL-safe Base64?
How much larger does Base64 make data?
Related tools
URL Encoder / Decoder
Developer Tools
Percent-encode and decode URLs and query parameters, with a query string breakdown.
Text to Binary Converter
Converters
Convert text to binary, octal, decimal or hex and back, as UTF-8 bytes or code points.
Hash Generator
Developer Tools
Generate SHA-256, SHA-384, SHA-512 or SHA-1 digests of text or a file, and verify a checksum.
ASCII Table
Developer Tools
Searchable ASCII reference with decimal, hex, octal, binary and escapes.