Text Encoding Tools
Input
Percent Encoding (URL Encoding)
Standard Base64
URL-Safe Base64
MIME Base64
Encoding Reference
Percent Encoding (URL Encoding)
Percent encoding (also known as URL encoding) converts characters into a format that can be safely transmitted over the internet in URLs. Each unsafe character is replaced with a percent sign (%) followed by two hexadecimal digits representing the character's ASCII/UTF-8 value.
Common Encoded Characters
| Character | Encoded | Description |
|---|---|---|
(space) | %20 | Space character |
! | %21 | Exclamation mark |
# | %23 | Hash/pound sign |
$ | %24 | Dollar sign |
% | %25 | Percent sign |
& | %26 | Ampersand |
+ | %2B | Plus sign |
/ | %2F | Forward slash |
Percent Encoding Use Cases
URL Query Parameters: Encoding parameter values in URLs like
?search=hello%20world.Form Data: Encoding form submissions sent via
application/x-www-form-urlencoded.OAuth & APIs: Encoding redirect URIs and callback URLs passed as parameters.
Specification
- RFC 3986 - Uniform Resource Identifier (URI): Generic Syntax
- Unreserved characters (
A-Z,a-z,0-9,-,.,_,~) are never encoded.
Base64 Encoding
Base64 converts binary data to ASCII text using 64 characters. It's used for embedding binary data in text formats.
Character Sets & Line Breaks
| Variant | Characters 62-63 | Padding | Line Breaks |
|---|---|---|---|
| Standard | + / | = | None |
| URL-Safe | - _ | None | None |
| MIME | + / | = | Every 76 chars |
Base64 Use Cases
Standard Base64: Data URIs, JSON payloads, API responses, configuration files, and general binary-to-text encoding.
URL-Safe Base64: JWT tokens, OAuth parameters, URL query strings, filename encoding, and web API identifiers.
MIME Base64: Email attachments, SMTP transmission, HTTP headers, and legacy systems with line length limits.
Specifications
- RFC 4648 - Base64 Data Encodings
- RFC 2045 - MIME Base64 Content-Transfer-Encoding
- All variants use the same 62-character alphabet:
A-Z,a-z,0-9, but differ in the final two characters. - URL-Safe replaces
+and/with-and_to avoid conflicts with URL path separators and query parameters.
Base64 vs Percent Encoding
| Base64 | Percent | |
|---|---|---|
| Purpose | Binary to text | URL safety |
| Output Size | ~133% | Variable |
| Use Case | Embed data | URL parameters |