Ad
DevToolXDevToolX

URL Encoder/Decoder

Encode or decode URL strings

About URL Encoder/Decoder

URL encoding — formally percent-encoding per RFC 3986 — converts characters that are not allowed or carry special meaning in a URL into a % followed by two hex digits. It is not Base64: it encodes only the characters that would break URL parsing, leaving safe characters untouched. This tool encodes and decodes those strings, which is essential when constructing query strings, redirect URLs, or any URL that contains user-supplied input.

Common Use Cases

Encode query string parameter values
Characters like &, =, and + have structural meaning in a query string; encoding them in each value prevents the parser from misreading the parameter boundaries.
Embed a redirect URL inside another URL
A redirect_uri parameter that is itself a full URL must be percent-encoded so the outer URL parser does not misinterpret its slashes and query characters.
Construct URLs from user-supplied text
Encoding spaces, Unicode characters, and punctuation in user input before inserting them into a URL prevents broken links and injection issues.
Debug mangled URLs in logs
Decode a percent-encoded URL from a server log or network trace to read the original parameter values and reproduce the exact request.

Frequently Asked Questions

Why does + sometimes mean a space?

In HTML form encoding (application/x-www-form-urlencoded), + represents a space character for historical reasons. In strict RFC 3986 percent-encoding used in URL paths and query strings, a space is encoded as %20, not +. The difference matters when you are reading POST body data versus URL parameters.

Why must & be encoded inside a query parameter value?

The & character is the delimiter between query parameters. If a value itself contains &, the URL parser will treat it as the start of a new parameter. Encoding it as %26 keeps it inside the value.

What is the difference between encodeURI and encodeURIComponent in JavaScript?

encodeURI encodes a full URL and leaves the structural characters (:, /, ?, &, =, #) alone because they are valid URL delimiters. encodeURIComponent encodes everything except unreserved characters — use it for individual parameter names and values, not for entire URLs.

When do I need to double-encode?

Double-encoding is needed when a percent-encoded string will itself appear as a value in another URL — for example, a redirect_uri that already contains %20. After you encode the inner URL, its % signs become %25 so the outer URL parser leaves them intact. Decode only once on the receiving end.

Is URL encoding the same as HTML entity encoding?

No. URL encoding uses % notation (%26 for &). HTML entity encoding uses ampersand notation (& for &). They serve different contexts — use URL encoding in URLs, and HTML entities in HTML markup.

Related Tools