base64.
encode / decode utility
Input
Output
What is this?
This utility encodes and decodes text or binary data into Base64 format. It operates entirely on the client-side within your browser, ensuring maximum privacy.
Base64 is a binary-to-text encoding scheme. It translates raw data into a safe ASCII string format, allowing complex data to pass smoothly through systems designed strictly for plain text.
Use Cases
Data URIs
Embed small assets (images, SVGs, fonts) directly into HTML or CSS as `data:image/png;base64,…` to reduce external HTTP requests.
Auth Headers
HTTP Basic Authentication transmits credentials encoded as a Base64 string in the format `username:password`.
JWT Payloads
JSON Web Tokens utilize Base64Url encoding to safely transmit claims between parties as a compact, URL-safe string.
MIME Email
Base64 is heavily used to safely attach non-text files and images to emails routed over older 7-bit ASCII systems.
FAQ
Is Base64 encryption?
No. Base64 is an encoding scheme, not encryption. It hides nothing. Anyone with a decoder can read Base64 strings. Never use it alone to protect passwords, API keys, or sensitive secrets.
What is URL-safe Base64?
Standard Base64 uses + and /. These characters break URLs. The URL-safe variant replaces + with - and / with _, and often omits padding, making it safe for links and JWTs.
Why does it end in ‘=’?
The = is padding. Base64 processes data in 3-byte chunks. If the original data isn’t perfectly divisible by 3, padding is added so the final string length is a multiple of 4, ensuring parsers read it correctly.
Does it increase file size?
Yes. Because it uses 4 text characters to represent 3 bytes of binary data, the resulting Base64 string will always be roughly 33% larger than the original input data.
Why does decoding fail?
Errors usually happen due to missing padding (=), hidden whitespace/newlines, or attempting to decode a URL-safe string with a standard decoder. Our tool tries to fix padding and whitespace automatically.
Can I encode images?
Yes, any binary data can be encoded. Paste the raw bytes, or if you have a file, you’d convert the file to a byte stream first. This is common for embedding small graphics in frontend code.
