What is Base64 encoding used for?
Base64 translates binary data into a standard ASCII string format. It is used in email protocols, for embedding images directly into CSS files, and for encoding API authentication headers.
Base64 Text & Image Encoding Suite
System Definition BlockBase64 turns binary data into plain ASCII text so it can travel through systems built for words — email, JSON, URLs and HTML. This toolkit runs in both directions. Type or paste text and it encodes to Base64, converting through UTF-8 first so accented and non-Latin characters survive; paste a Base64 string and it decodes back to readable text. Hand it an image instead and it returns a complete data URI — the data:image string you paste into an img tag or a CSS background — generated in your browser with the FileReader API, never uploaded. Decoding earns its keep too — inspecting a token, an authorization header or a MIME attachment starts with seeing the plain text underneath. Every conversion happens on your own machine.
Base64 works on bytes in threes. Take 3 bytes of input — 24 bits — and split them into four groups of 6 bits. Each group, a number from 0 to 63, selects one character from the 64-character alphabet — A to Z, a to z, 0 to 9, then + and /. Watch it happen with the word Cat. The bytes are 67, 97 and 116, in binary 01000011 01100001 01110100. Regrouped in sixes — 010000, 110110, 000101, 110100 — they are the numbers 16, 54, 5 and 52, which select Q, 2, F and 0. Cat encodes to Q2F0. When the input is not a multiple of three, the remainder explains the = signs on so many strings. One leftover byte, such as A, fills two characters and takes two padding signs — QQ==. Two leftover bytes, such as Hi, fill three characters and take one — SGk=. Padding holds no data — it tells the decoder how many real bytes the final group contains.
.loading-spinner {
width: 24px;
height: 24px;
/* Embedding the image directly prevents a separate HTTP request */
background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz...');
background-repeat: no-repeat;
}// How to encode a string to Base64 in Node.js
const authString = 'username:password';
const encodedAuth = Buffer.from(authString).toString('base64');
console.log(`Basic ${encodedAuth}`);Base64 translates binary data into a standard ASCII string format. It is used in email protocols, for embedding images directly into CSS files, and for encoding API authentication headers.
No. Base64 is merely a data translation format, not a cryptographic security measure. Anyone with a decoder can instantly read Base64 text. Do not use it to secure passwords.
No. The image is processed locally with the browser's native FileReader API and never uploaded to a server, so it uses zero bandwidth.
Every 3 bytes of input become 4 characters of output, so the encoded form is a third larger — 3 KB in, roughly 4 KB out — before any line wrapping. The overhead is the price of squeezing arbitrary bytes into an alphabet every system can carry; Base64 is a transport format, not a compression format.
Yes. Email and older tools wrap long strings at 76 characters. Paste it as it stands and use the line-by-line mode — each wrapped line is decoded in turn and the results joined, so you never stitch lines together by hand.
Looking for more professional developer utilities?
Explore All WebToolkit Pro ToolsExpert guides and technical research related to this tool.
Free, client-side utilities related to this topic.
A JSON Web Token carries a small JSON document — the claims —, usually to prove who a user is. It has three parts separated by dots: a header naming the signing algorithm, a payload holding claims such as sub (who the token is about), iss (who issued it), aud and exp (when it stops being accepted), and a signature. The header and payload are only Base64URL-encoded, never encrypted, so anyone holding the token can read them without it leaving your browser.
The Universal Number Base Converter is a high-speed mathematical matrix designed specifically for software engineers, embedded systems developers, and computer science students. Translating data across different numeric bases is a fundamental requirement when debugging low-level network packets, memory dumps, or assembly code. This tool effortlessly bridges the gap between Binary (Base-2), Decimal (Base-10), Hexadecimal (Base-16), and standard ASCII text. The advanced client-side detection engine automatically identifies the format of your pasted input and instantly populates the conversions for all other bases in real-time. Whether you are translating machine code strings or decoding hex payloads, this tool utilizes native JavaScript big integer math to deliver accurate, offline, and instantaneous conversions without the latency of server roundtrips.
Cross-Site Scripting (XSS) remains one of the most critical security vulnerabilities in modern web applications. If an application reflects un-encoded user input directly into the HTML DOM, attackers can inject malicious JavaScript. Strict HTML entity encoding sanitizes these inputs by neutralizing execution contexts. This tool allows security engineers and developers to instantly verify how their application's WAF (Web Application Firewall) or sanitization logic should encode dangerous payloads.
Decode JWT tokens instantly
Encode query strings safely
MD5, SHA-256, SHA-512
Encode special characters