URL Encoder & Decoder
Encode or decode URLs and query strings instantly. Supports percent encoding and Base64 URL encoding.
🔤
URL Encoding
Converts special characters into % followed by two hex digits. Spaces become %20. Required for safe URLs.
🧩
Component Encoding
encodeURIComponent encodes everything except A-Z a-z 0-9 - _ . ! ~ * ( ). Use for query string values.
📦
Base64 URL
Encodes binary data as ASCII text using URL-safe characters. Used in JWTs, API tokens and file sharing.
Frequently Asked Questions
When do I need to URL encode a string?
You need to URL encode strings when including special characters such as spaces, ampersands, equals signs, or non-ASCII characters in a URL query parameter. Unencoded special characters can break URL parsing and cause requests to fail or be misinterpreted by servers.
What is the difference between URL encoding and Base64 encoding?
URL encoding (percent-encoding) replaces special characters with a percent sign followed by their hexadecimal value, making strings safe for use in URLs. Base64 encoding converts binary data to an ASCII string and is used for embedding data in text formats. They serve different purposes and are not interchangeable.
Does this tool encode spaces as + or %20?
The tool uses standard percent-encoding which represents spaces as %20. Some older form-encoded formats use + for spaces, but %20 is the correct encoding for URL path and query components per RFC 3986. Both are decoded by most servers, but %20 is the safer and more standards-compliant choice.
What is URL encoding?
URL encoding (percent encoding) converts characters that are not allowed in URLs into a safe format. For example, spaces become %20, ampersands become %26. This ensures URLs are transmitted correctly across the internet.
What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a complete URL, leaving characters like / : ? & intact. encodeURIComponent encodes everything except alphanumeric characters and - _ . ! ~ * — use it for individual query string parameter values.
When should I use Base64 URL encoding?
Base64 URL encoding is used when you need to transmit binary data as text in a URL-safe format. Common uses include JWT tokens, OAuth state parameters, file attachment IDs, and API authentication tokens.
🛡️
Your IP address and DNS queries are visible to your ISP.
Protect your privacy with a trusted VPN — tested and recommended by Anonymiz.
See Recommended VPNs →