How to use
- Choose Encode to turn text into Base64, or Decode to turn Base64 back into text.
- Paste your text or Base64 string into the Input box. The Output updates as you type.
- Press Copy to copy the result.
Examples
| Input | Output |
|---|---|
Hello, world! | SGVsbG8sIHdvcmxkIQ== |
5pel5pys | 日本 |
café | Y2Fmw6k= |
About this tool
What Base64 does
Base64 turns any bytes into text made of 64 safe characters: A–Z, a–z, 0–9, + and /, with = as padding. Every 3 bytes become 4 characters, so encoded data is about a third larger than the original. Hello (5 bytes) becomes SGVsbG8=; the = fills out the last group of four.
It exists so binary data can travel through channels built for text: email attachments (MIME), data: URLs in HTML and CSS, JSON fields, HTTP Basic authentication headers and the three parts of a JSON Web Token.
Encoding is not encryption
Base64 has no key and no secret. Anyone can decode it instantly, with this page or a single line of code. Never use it to hide passwords, API keys or personal data; a Base64 string in a config file or a URL is as readable as plain text to anyone who looks. If you need confidentiality, use real encryption.
Text, bytes and UTF-8
Base64 works on bytes, not letters, so text has to be turned into bytes first. This tool uses UTF-8, the encoding of almost every modern web page. ASCII letters take one byte each, accented letters two (é → w6k=), and Chinese or Japanese characters three: 日本 encodes to 5pel5pys. A tool that uses a different character encoding, such as UTF-16 or Shift_JIS, produces a different Base64 string for the same text.
When decoding, the bytes must form valid UTF-8 text. If they don't, for example because the Base64 holds an image or a ZIP file, the output stays empty.
Forgiving decoding
Line breaks and spaces in the input are ignored, so you can paste Base64 wrapped at 76 characters, as found in email source. Missing = padding is added for you, and the URL-safe alphabet, which uses - and _ instead of + and / and appears in JWTs, is accepted too.
Frequently asked questions
Is Base64 encryption?
No. Base64 is a reversible encoding with no key, so anyone can decode it. Don't use it to protect passwords or personal data.
Why does my Base64 end with = or ==?
Base64 encodes 3 bytes as 4 characters. When the input length isn't a multiple of 3, the last group is padded with one or two = signs.
Why do Chinese characters give a different result on another site?
This tool encodes text as UTF-8, where each Chinese character is 3 bytes. A tool using UTF-16 or Big5 turns the same text into different bytes, so the Base64 differs.
How much bigger does Base64 make data?
About 33%: every 3 bytes become 4 characters, with the last group padded to a full 4.
Is my data sent to a server?
No. Encoding and decoding happen in your browser, and nothing you paste leaves your device.