Base64 Encoder & Decoder
Free Online Base64 Converter with Full UTF-8 Support
Convert text to Base64 or decode Base64 back to readable text. Supports full UTF-8, so non-ASCII characters (Chinese, emoji, accents) encode and decode correctly. All processing happens locally in your browser.
How to Use the Base64 Converter
1. Choose a Mode
Click Encode to convert text into Base64, or Decode to convert Base64 back into text.
2. Enter Your Data
Paste your text or Base64 string into the input box.
3. Copy the Result
The converted output appears instantly. Click Copy Result to copy it to your clipboard.
What is Base64?
Base64 is a binary-to-text encoding scheme that represents binary data using 64 ASCII characters (A-Z, a-z, 0-9, + and /). It is widely used to embed binary content such as images, files, or non-ASCII text inside text-based formats like JSON, XML, HTML, and email (MIME).
A common pitfall is that many tools use JavaScript's btoa/atob, which break on non-ASCII characters. This tool uses TextEncoder and TextDecoder to handle full UTF-8, so strings with Chinese, Japanese, emoji, or accented characters encode and decode correctly every time.
How Three Bytes Become Four Characters
Base64, specified in RFC 4648, takes input three bytes (24 bits) at a time and splits them into four groups of six bits. Each 6-bit group is a number from 0 to 63, looked up in a fixed alphabet: A–Z are 0–25, a–z are 26–51, 0–9 are 52–61, then + and /.
Take the word Cat. Its bytes are 67, 97, 116, or in binary 01000011 01100001 01110100. Regrouped into sixes: 010000 110110 000101 110100, which is 16, 54, 5, 52, which maps to Q, 2, F, 0. So Cat encodes to Q2F0. Try it in the tool above.
When the input length is not a multiple of three, the last group is padded with =. Ca becomes Q2E= and C becomes Qw==. Because every three bytes become four characters, Base64 output is always about 33% larger than the input.
Where You Run Into Base64
Reading a JWT
A JSON Web Token is three Base64url segments joined by dots. The middle segment is the payload. Paste just that segment into Decode to see claims like "sub" and "exp". Base64url swaps + for - and / for _ and drops padding; if decoding fails, change those characters back and add = until the length is a multiple of 4.
HTTP Basic authentication
The header Authorization: Basic YWxpY2U6czNjcmV0 is simply alice:s3cret encoded. Decoding it here shows why Basic auth must only be used over HTTPS: anyone who sees the header can read the password.
Kubernetes secrets and config
Values in a Kubernetes Secret manifest are stored Base64-encoded. Encode a value before pasting it into the YAML, or decode one to check what is deployed. Watch for a trailing newline: encoding password and password⏎ gives different results, and the second will break a login.
Why This Tool Handles Non-English Text Correctly
Base64 works on bytes, not characters. The browser function btoa() only accepts characters whose code is below 256, so btoa("café ☕") throws an error in every browser. This page first converts your text to UTF-8 bytes with TextEncoder, then encodes those bytes. Decoding reverses the steps with TextDecoder.
The practical result: こんにちは encodes to 44GT44KT44Gr44Gh44Gv, and decoding that string gives you the same Japanese text back. Any other tool or programming language that uses UTF-8 (which is nearly all of them today) will produce the same output.
Common Mistakes
- Treating Base64 as encryption. It is an encoding anyone can reverse in a second. Never use it to "hide" passwords or API keys.
- Decoding binary data as text. If the Base64 came from an image or PDF, the decoded bytes are not readable text and will show as garbled characters.
- Copying with line breaks. Email (MIME) wraps Base64 at 76 characters. Most decoders ignore the line breaks, but spaces or stray characters in the middle cause "invalid character" errors.
- Mixing up Base64 and percent-encoding. To put text safely into a URL, use the URL Encoder. Base64 output itself contains
+and/, which also need escaping in URLs.
To check data integrity rather than transport it, create a checksum with the Hash Generator. Decoded payloads that turn out to be JSON can be tidied in the JSON Formatter. More in developer tools.
Frequently Asked Questions
Is Base64 encryption?
No. Base64 is a reversible encoding with no key. Anyone can decode it, so it provides no security.
Why does Base64 output end with = or ==?
The equals signs are padding. They appear when the input length is not a multiple of three bytes, so the output length stays a multiple of four.
How much bigger does Base64 make my data?
About 33 percent. Every three input bytes become four output characters, plus up to two padding characters.
Can I decode a JWT with this tool?
Yes. Paste the middle segment between the two dots. If it fails, replace - with + and _ with /, and add = padding until the length is a multiple of four.
Does it work with emoji and accented characters?
Yes. Text is converted to UTF-8 before encoding, so emoji, accents and non-Latin scripts round-trip correctly.