Base64 encoder and decoder
Convert text to Base64 and back. UTF-8 safe, with URL-safe and no-padding options.
tool 05 of 12 []
all shortcuts ?
How to use it
- Type or paste text and press Encode to get its Base64 form, or paste Base64 and press Decode.
- Text is converted to UTF-8 bytes first, so accented letters, CJK text and emoji round-trip correctly.
- Tick URL-safe to use the Base64URL alphabet used in JWTs and URLs (- and _ in place of + and /). Decoding accepts both alphabets automatically and tolerates line breaks and missing padding.
- If the decoded bytes are not valid UTF-8 text (an image, say), the tool says so and shows the first bytes in hex rather than printing garbage.
Examples
Select an example to load it into the tool.
- ASCII text
Hello, world - Unicode
Café ☕ 日本語 - Base64 to decode
SGVsbG8sIHdvcmxk
Frequently asked questions
Is Base64 encryption?
No. Base64 is an encoding that anyone can reverse. It makes binary data safe to carry in text formats, but it provides no secrecy, so never use it to hide passwords or keys.
Why is the output about a third larger?
Every 3 bytes of input become 4 characters of output, so Base64 adds roughly 33 percent overhead, plus padding.
What is Base64URL?
A variant from RFC 4648 that swaps + and / for - and _ and usually drops the = padding, so the result is safe inside URLs and filenames. JWT segments use it.
Why does decoding fail on my string?
Common causes are characters outside the alphabet (a stray quote or comma), a truncated copy that leaves one extra character, or data URL prefixes such as data:image/png;base64, which should be removed first.
Does this work for files or images?
This page handles text. Binary results are detected and shown as hex. For files, a command such as base64 file.png in a terminal is the right tool.