Encoding
Base64
Base64 encode and decode — text and files, right in your browser.
Base64 is a binary-to-text encoding that represents arbitrary bytes using 64 printable ASCII characters (A–Z, a–z, 0–9, plus + and /). It exists so binary data — images, archives, cryptographic keys — can pass unchanged through channels that were designed for text only.
This tool encodes and decodes both plain text and files. Everything runs client-side in your browser: the input never leaves your machine, which makes it safe for tokens, private keys, and other sensitive data.
How to use it
- Encode text: pick the Encode / Text mode, paste your string, and copy the Base64 result.
- Encode a file: switch to File mode and choose a file — you get its Base64 representation, ready for a data URI or JSON field.
- Decode: switch to Decode mode and paste a Base64 string; if it decodes to a known file type you can download the original file.
Common uses
- Embedding small images or fonts directly in CSS/HTML via data: URIs.
- Putting binary payloads inside JSON, XML, or form fields.
- Encoding credentials for the HTTP Basic Authorization header.
- Storing or transmitting PEM keys and certificates.
Things to keep in mind
Base64 is not encryption — anyone can decode it. It only changes the representation of data, not its confidentiality.
Encoded output is about 33% larger than the input because every 3 bytes become 4 characters.
For URLs and file names use Base64URL, which swaps + and / for - and _ and often drops the = padding.
Article about this tool: Base64: why encoding is needed and how it works
Frequently asked questions
What is Base64 actually used for?
Base64 turns binary data into plain ASCII text so it can safely travel through systems that only handle text, like email bodies, JSON payloads, or embedding a small image directly in CSS/HTML.
Why is the encoded output bigger than my input?
Base64 packs 3 bytes of input into 4 output characters, so encoded text is roughly 33% larger than the original. This is expected and not a sign of an error.
Is my file or text uploaded anywhere?
No. Encoding and decoding happen entirely in your browser using JavaScript — nothing is sent to a server, so it works fine offline too.
How is standard Base64 different from Base64URL?
In Base64URL, the characters + and / are replaced with - and _, so the string can be safely dropped into a URL or file name without extra percent-encoding. This is the variant JWT uses.
What does the = character at the end of the string mean?
It's padding, showing how many bytes are missing from the final 3-byte block. It isn't always required — some systems deliberately drop it.