Base64 Encoder / Decoder
Encode and decode Base64 strings instantly
🔒 100% free · no signup · files never leave your device
Base64 exists because many systems were built to carry text, not binary data. Email attachments, JSON payloads, XML documents and data URLs all need a way to represent arbitrary bytes using only safe printable characters. Base64 does this by encoding every 3 bytes as 4 ASCII characters — which is why a Base64 string is always about 33% larger than the original data, and why it's an encoding scheme, not encryption: anyone can decode it instantly.
This free Base64 encoder and decoder converts text to Base64 and back with correct UTF-8 handling (so emoji and non-Latin scripts survive the round trip), supports URL-safe output for tokens and filenames, and can encode entire files into data URLs for embedding images directly in HTML or CSS. Everything happens locally in your browser, so encoding an access token, an ID scan or a private config value doesn't send it anywhere.
Why use Base64 Encoder / Decoder
Embedding small images as data URLs
Encoding an icon or tiny image as Base64 lets you inline it in HTML/CSS and skip an extra HTTP request on critical pages.
Decoding JWT payloads while debugging
JWT header and payload segments are URL-safe Base64 — decoding them reveals the claims without any library.
Passing binary data through JSON or XML
APIs that only accept text require binaries (signatures, certificates, small files) to be Base64-encoded first.
Building Basic Auth headers
HTTP Basic authentication is simply 'username:password' Base64-encoded — encoding it manually is handy for quick curl tests.
Pro tips
- Enable URL-safe mode when the output goes into a URL or filename — it replaces + and / with - and _ and avoids nasty escaping bugs.
- Don't Base64 large images for the web: the 33% size inflation plus CSS/JS parsing usually costs more than the saved request.
- Remember Base64 offers zero security. Never treat an encoded API key or password as protected — decode is one click.
- When decoding fails with 'invalid character', check for whitespace or newlines pasted along with the string — trimming usually fixes it.
How to use Base64 Encoder / Decoder
- 1Paste text or drop a file
- 2Choose Encode or Decode
- 3Copy the result
Frequently Asked Questions
Is Base64 encryption?▾
No. Base64 is an encoding, not encryption — anyone can decode it. Never use it to protect secrets.
Can I encode files?▾
Yes, drop any file to get its Base64 representation (useful for data URLs).