Base64 Encoder & Decoder
Base64 is a way of converting text or data into a string of characters that is safe to use anywhere that only accepts plain text. You will often see it used in web development when embedding images in CSS, sending data through APIs, or storing credentials in configuration files. This tool lets you encode any text into Base64 format, or decode a Base64 string back into readable text. Everything runs in your browser. Nothing is sent to a server.
Frequently Asked Questions
What is Base64 encoding?
Base64 converts data into a string of plain ASCII characters using only letters, numbers, plus signs, and slashes. This makes it safe to transmit data through systems that only handle text, like email or certain web APIs.
Why would I need to encode something in Base64?
Base64 is commonly used to embed images directly into HTML or CSS, send binary data in JSON API responses, store credentials in HTTP Basic Auth headers, and encode email attachments. It ensures data arrives intact through text-only systems.
Is Base64 a form of encryption?
No. Base64 is encoding, not encryption. It is not a security measure and anyone can decode a Base64 string instantly using a tool like this one. It is only used to safely represent binary data in text format, not to keep anything secret.
Why does Base64 output end with equals signs?
Base64 works in groups of three bytes. If the input length is not a multiple of three, padding characters (=) are added to complete the last group. One or two equals signs at the end is completely normal and expected.
How much larger is Base64 output than the original data?
Base64 encodes every 3 bytes as 4 ASCII characters, making output about 33% larger than the input. A 100KB file becomes approximately 133KB when Base64-encoded. This overhead is acceptable for small assets but makes Base64 impractical for large files. For anything over a few kilobytes, direct binary transfer is significantly more efficient.
What is URL-safe Base64?
Standard Base64 uses + and / which are reserved in URLs. URL-safe Base64 replaces + with - and / with _ so the string can appear in a URL without percent-encoding. It is used in JWT tokens, OAuth parameters, and API keys. If you see a Base64-like string with hyphens and underscores instead of + and /, it is URL-safe Base64.
Can Base64 encode images and binary files?
Yes. Base64 encodes any binary data, not just text. Small images are often embedded in CSS as data URIs: data:image/png;base64,[encoded]. This eliminates one HTTP request. Emails also use Base64 to embed attachments inside the message body. This tool handles text input; for binary files, use a tool that reads the raw file bytes before encoding.
How It Works
Base64 converts binary data into ASCII text using a 64-character alphabet (A-Z, a-z, 0-9, +, /). Every 3 bytes of input become 4 Base64 characters. The browser's btoa() function encodes and atob() decodes. The algorithm is defined in RFC 4648 and is identical across all implementations — any Base64 encoder produces the same output for the same input.
Common Uses
Base64 is used to embed images in HTML/CSS as data URIs, to encode email attachments in MIME format, to include binary credentials in HTTP Basic Auth headers, to store small binary values in JSON APIs, and to transmit cryptographic keys and certificates as PEM files. Whenever a text-only channel needs to carry binary data, Base64 is typically used.
Base64 is Not Encryption
Base64 is encoding, not encryption. Anyone can decode it instantly. Never use Base64 to protect sensitive data — it provides no security whatsoever. Base64 strings are recognizable by their character set and the = padding at the end. If you need to secure data, use actual encryption algorithms like AES-256, not encoding.
When to Use This
Use to encode a string for use in an HTTP Basic Auth header (username:password in Base64), to create a data URI for a small image or font to embed inline in CSS, to decode a Base64 payload from an API response or JWT token body, or to verify that a Base64 string decodes to the expected value.
More Free Tools
Random Weight Generator
Generate random probability weights for any number of items using Dirichlet distribution sampling.
Screen Resolution Checker
See your screen resolution, viewport size, device pixel ratio, and display details.
URL Redirect Checker
Trace where any link goes before you click it and see the final destination URL.
Case Converter
Convert text to uppercase, lowercase, title case, sentence case, or camelCase.