Developer Tool
Base64 Encoder & Decoder
Convert text to Base64 and back, with correct handling of non-English characters.
Runs in your browser — nothing is uploaded
What this does
Base64 represents arbitrary bytes using 64 characters that survive being copied through systems built for plain text — which is why it turns up in data URLs, email attachments, HTTP Basic authentication headers and the three parts of a JSON Web Token.
A common bug with Base64 in the browser is that the built-in btoa function only accepts characters in the Latin-1 range, so text containing emoji or scripts such as Devanagari fails. This tool converts your text to UTF-8 bytes first, so any text round-trips correctly.
How to use it
- Type or paste text and press Encode, or paste Base64 and press Decode.
- Tick URL-safe to use - and _ instead of + and /, without = padding — the variant used in URLs and in JWTs.
- Copy the result with the Copy button.
Where it stops being right
- This tool handles text. Decoding Base64 that represents a binary file (an image, say) produces bytes that are not valid text, and the tool reports that instead of showing garbage.
- Base64 output is about a third larger than the input, because every three bytes become four characters.
Questions
- Is Base64 a form of encryption?
- No. It is an encoding with no key: anyone can decode it instantly. Never use it to hide a password or a secret.
- What is URL-safe Base64?
- A variant that replaces + with - and / with _, and usually drops the = padding, so the result can sit inside a URL or a filename without being escaped.
- Why did decoding fail?
- Usually the input has characters outside the Base64 alphabet, was cut off partway through, or decodes to bytes that are not valid UTF-8 text.
More developer tools
- URL Encoder & DecoderPercent-encode text for use in a URL, or decode an encoded URL back into readable text.
- JSON Formatter & ValidatorPretty-print, minify and check JSON, with the position of any syntax error.
- JWT DecoderRead the header and payload of a JSON Web Token, with its dates shown in plain language.
- UUID GeneratorGenerate random version 4 UUIDs, one at a time or in bulk.