Free Online Base64 Encoder and Decoder
Convert text to Base64 or decode Base64 back to plain text instantly with our free online Base64 encoder decoder.
Conversion happens in real time as you type — no button clicks needed.
All processing runs entirely in your browser using JavaScript —
your data never leaves your device.
How to Use
- Select Encode to convert plain text to Base64, or Decode to convert Base64 back to text
- Paste or type your input on the left
- The result appears instantly on the right
- Click Copy Output to copy the result to your clipboard
- Use Swap to flip input and output and continue working in the other direction
Features
- Real-time conversion — encodes or decodes as you type with a 300ms debounce
- Unicode support — correctly handles multi-byte UTF-8 characters
- Swap button — flip input and output to go in the other direction instantly
- One-click copy — copy the full output to clipboard in one click
- Error messages — invalid Base64 input shows a clear explanation
- Character count — input and output length displayed in the stats bar
- 100% client-side — your data never leaves your browser, works offline
- Dark mode first — developer-friendly dark theme with light mode toggle
- Mobile responsive — works on phones and tablets
What is Base64?
Base64 is an encoding scheme that converts binary data (including text) into a string of ASCII characters.
It uses a 64-character alphabet — A–Z, a–z, 0–9, and the characters + and / —
to represent any binary sequence. The output is padded with = characters to make its length
a multiple of 4.
Base64 was designed to transmit binary data over channels that only handle plain text.
A common example is sending files as email attachments or embedding images directly in HTML/CSS using
data URIs. It is also widely used in HTTP Basic Authentication headers, JSON Web Tokens (JWTs),
and API keys.
Base64 Encoding Example
Plain text input:
Hello, World!
Base64 encoded output:
SGVsbG8sIFdvcmxkIQ==
Base64 Decoding Example
Base64 input:
eyJ1c2VyIjoiYWxpY2UiLCJyb2xlIjoiYWRtaW4ifQ==
Decoded plain text:
{"user":"alice","role":"admin"}
Common Uses of Base64
- JWT tokens — the header and payload sections of JSON Web Tokens are Base64url-encoded
- Email attachments — MIME encodes binary files (images, PDFs) as Base64 for email transport
- Data URIs — embed images and fonts directly in HTML/CSS without separate HTTP requests
- API authentication — HTTP Basic Auth sends
username:password Base64-encoded in the Authorization header
- Storing binary in JSON — JSON cannot natively represent binary data, so binary fields are often Base64-encoded strings
- Obfuscation — not encryption, but Base64 is sometimes used to encode configuration values to avoid accidental modification
Base64 vs Base64url
Standard Base64 uses + and / characters, which have special meaning in URLs.
Base64url replaces them with - and _ respectively, making the output safe to use
in URLs and filenames without percent-encoding. JWT tokens use Base64url. This tool uses standard Base64.
Frequently Asked Questions
Is Base64 encryption?
No. Base64 is an encoding, not encryption. It is fully reversible by anyone without a key. Do not use Base64 to protect sensitive data — use actual encryption for that. Base64 is for making binary data safe to transmit as text.
Is my data safe?
Yes. All encoding and decoding happens entirely in your browser using JavaScript. Your input is never sent to any server. This tool works offline too.
Why does Base64 output end with = or ==?
Base64 encodes 3 bytes as 4 characters. If the input length isn't divisible by 3, the output is padded with = signs to reach the next multiple of 4. One = means 2 input bytes were in the last group; two == means 1 byte was in the last group.
Why does Base64 make data larger?
Base64 encodes every 3 bytes of input as 4 characters of output — a ~33% size increase. This overhead is the trade-off for making binary data safe to transmit over text-only channels.
What is a data URI?
A data URI embeds file content directly in HTML or CSS instead of linking to an external file. Example: src="data:image/png;base64,iVBORw0KGgo...". Useful for small images that would otherwise require an extra HTTP request.
Can this tool decode JWT tokens?
Partially. JWT tokens use Base64url (not standard Base64) and consist of three dot-separated parts. You can decode each part individually after replacing - with + and _ with /. For full JWT inspection, use a dedicated JWT decoder.