Base64 / URL Encoder
Encode and decode Base64 and URL-encoded text instantly, both directions.
Base64 and URL Encoder/Decoder - Free Online Tool
Convert text to and from Base64 encoding, or percent-encode and decode URL components. Choose your encoding mode, type in either the input or output box, and click Encode or Decode for instant results. Full UTF-8 support means emoji, accented characters, and non-Latin scripts are handled correctly. Everything runs locally with zero server communication.
What is Base64 Encoding?
Base64 is a method of encoding binary data (or text) into a string of printable ASCII characters. It uses 64 characters (A-Z, a-z, 0-9, + and /) plus = for padding. Base64 is commonly used to embed images in CSS or HTML, transmit binary data through text-only protocols like email (MIME), store complex data in JSON strings, and encode authentication credentials in HTTP headers.
The encoded output is approximately 33% larger than the input, since every 3 bytes of input become 4 characters of output. This tradeoff is worthwhile when you need to safely transmit or store binary data in text contexts.
What is URL Encoding?
URL encoding (percent-encoding) converts characters that have special meaning in URLs into safe representations using % followed by two hexadecimal digits. For example, a space becomes %20, an ampersand becomes %26, and a question mark becomes %3F. This ensures that parameter values, file names, and other data in URLs do not conflict with URL syntax characters.
You need URL encoding when constructing query parameters with special characters, embedding user input in URLs, working with API endpoints that require encoded parameters, or debugging URLs that contain percent-encoded characters you need to read.
Common Use Cases
Developers use Base64 encoding to embed small images as data URIs in CSS (avoiding extra HTTP requests), to encode API authentication tokens (Basic Auth header), to include binary data in JSON payloads, and to encode email attachments. URL encoding is essential for building dynamic URLs, handling form submissions, constructing API calls with special characters in parameters, and debugging encoded URLs.
UTF-8 and International Character Support
This tool correctly handles multi-byte UTF-8 characters including emoji, Chinese/Japanese/Korean characters, Arabic, Cyrillic, and accented Latin characters. When encoding UTF-8 text to Base64, the tool first converts to UTF-8 bytes, then applies Base64 encoding. Decoding reverses the process correctly, preserving all special characters.
Tips for Working with Encoding
Always decode Base64 strings before trying to read their content - Base64 is encoding, not encryption. Anyone can decode it, so never use Base64 alone for security-sensitive data. For URLs, encode individual parameter values rather than the entire URL to avoid breaking the URL structure.
When debugging API issues, check whether values are being double-encoded (encoded twice). This common mistake produces URLs like %2520 (the % of %20 getting encoded again) and causes subtle bugs that are hard to spot without a decoder tool.
Frequently Asked Questions
Is Base64 encryption? No. Base64 is encoding, not encryption. It provides no security - anyone can decode it. Its purpose is to safely represent binary data as text, not to hide information.
Why is the Base64 output larger than the input? Base64 represents every 3 bytes using 4 ASCII characters, resulting in approximately 33% size increase. This overhead is the cost of converting arbitrary bytes into safe printable characters.
When should I use URL encoding vs Base64? Use URL encoding for data that goes into URLs (query parameters, path segments). Use Base64 for binary data that needs to be transmitted as text (images in CSS, API payloads, email attachments).
Can I encode files? This tool encodes text strings. For encoding entire files (images, documents) to Base64, you would need a file-to-Base64 converter that reads the binary file data.