URL Encoder / Decoder
Encode and decode URLs with percent-encoding. Handles special characters, spaces, symbols and Unicode for API requests and query strings.
Invalid encoded text — check the input and try again.
Encode and decode URLs with percent-encoding. Handles special characters, spaces, symbols and Unicode for API requests and query strings.
Invalid encoded text — check the input and try again.
URL encoding (also called percent-encoding) converts characters that cannot appear in a URL into a safe format: a % sign followed by two hexadecimal digits. For example, a space becomes %20, an ampersand becomes %26, and a plus sign becomes %2B. This ensures that URLs are correctly interpreted by browsers and servers regardless of the characters they contain.
URL encoding is required whenever a URL contains characters outside the standard ASCII set or characters that have a reserved meaning in URLs. Common scenarios include: building query strings (?q=hello%20world), passing file paths as parameters, sending special characters in form data, and constructing API requests programmatically.
JavaScript provides two encoding functions. encodeURI encodes a complete URL, preserving characters like /, ?, #, : and = that have structural meaning in a URL. encodeURIComponent encodes a URL component (such as a query parameter value) and converts all reserved characters too. This tool uses encodeURIComponent, which is the right choice when encoding individual values that will be embedded inside a larger URL.
URL encoding converts characters not allowed in a URL into a %XX format where XX is the hex value of the character. A space becomes %20, / becomes %2F, etc. It ensures URLs are transmitted correctly over the internet.
Encode any special characters when including them in query parameters, API endpoints, or form action URLs. If you're building a URL dynamically in code, always encode the parameter values — never the full URL structure.
%20 is the percent-encoded representation of a space character. Similarly, %2F = /, %3F = ?, %3D = =, %26 = &.
encodeURI preserves URL structure characters (/, ?, #, :). encodeURIComponent encodes everything, including those characters. Use encodeURIComponent for individual parameter values, and encodeURI only for full URLs.