Base64 Encode / Decode
Encode text to Base64 or decode it back.
Base64 turns binary data into plain ASCII text, commonly used for embedding images in code, API tokens and email attachments.
How to use
- Paste text to encode, or Base64 to decode.
- Click the direction you need — the result appears below.
- Copy it with one click.
About this tool
Note: Base64 is encoding, not encryption — anyone can decode it. Never treat it as secure.
All processing happens locally in your browser.
How it works
Base64 turns binary data into plain ASCII text. It takes every 3 bytes (24 bits), splits them into four 6-bit groups, and maps each group to one of 64 characters: A–Z, a–z, 0–9, +, /. When the input length is not a multiple of 3, = padding is added so the output length is always a multiple of 4.
For example, 'Man' (bytes 4D 61 6E) becomes 'TWFu'. 'Ma' (2 bytes) becomes 'TWE=' — the missing byte is replaced by one = pad. Three input bytes always produce exactly four output characters, so Base64 output is roughly 33% larger than the input.
Base64 is encoding, not encryption — anyone can decode it instantly. It exists so binary data can travel through text-only channels: email attachments (MIME), data URIs in CSS and HTML, and JSON fields that must stay valid UTF-8.
Worked examples
A quick sanity check: Encode 'hello' and you get 'aGVsbG8=' — five input bytes become eight output characters with a single = pad. Decode it back and you get 'hello' again, byte for byte.
Binary data inside JSON: An API returning a small thumbnail can embed it as {"thumb": "iVBORw0KGgo..."} instead of a second download — the client decodes the string back to image bytes.
Quick reference
| Input bytes | Output chars | Padding |
|---|---|---|
| 3 | 4 | none |
| 2 | 4 | one = |
| 1 | 4 | two == |
The 64-character alphabet: A–Z map to values 0–25, a–z to 26–51, 0–9 to 52–61, then + is 62 and / is 63.
Frequently asked questions
Is Base64 encryption?
No — it is just an encoding. Anyone can decode Base64, so never use it to "protect" secrets.
Does it support emoji and Chinese characters?
Yes — this tool handles full Unicode correctly.
Is my input uploaded?
No. Everything runs in your browser.
More free tools
UUID Generator
Generate random v4 UUIDs in bulk.
Color Converter (HEX ↔ RGB)
Convert HEX to RGB and back, with live preview.
JSON Formatter & Validator
Format, minify and validate JSON in one click.
What Is My IP
See your public IP address instantly. No sign-up, nothing stored.
URL Encoder / Decoder
Encode or decode URLs and query strings.
Unix Timestamp Converter
Convert timestamps to dates and back.