A practical guide to URL encoding
What is URL encoding?
URL encoding, also called percent encoding, represents certain characters as percent signs followed by hexadecimal byte values. For example, a space becomes %20, and an ampersand can become %26. Non-ASCII text is encoded as UTF-8 bytes, with each byte represented by a percent escape when needed. Decoding turns valid escapes back into text.
A URL has structure: its scheme, host, path, query, and fragment have different roles. Characters such as ?, &, =, and / may have special meaning in a URL. Encoding a value prevents those characters from accidentally being interpreted as separators when the value is placed into a component.
Common developer uses
Encoding is useful when building query parameters from a user's search phrase, preparing an individual path segment, or sending a value containing spaces and punctuation. For example, encode the query value tea & coffee as tea%20%26%20coffee, then put it after a parameter name such as ?q=. The ampersand stays part of the value rather than appearing to start another parameter.
This tool operates on a URL component, not an entire URL. Enter the value you want to use and select Encode; select Decode to reverse valid percent escapes. Encoding a full address here also encodes its structural punctuation, so it will not produce a normal clickable address. Build the complete URL separately from its components.
How to fix common errors
If decoding reports an error, inspect every percent sign. It must be followed by two hexadecimal digits: %2F is valid, while %2 and %GG are not. Escapes that form invalid UTF-8 byte sequences also fail in this tool. Confirm the source used UTF-8 and that the encoded value was copied completely.
Watch for double encoding. An already encoded space, %20, becomes %2520 if encoded again because the percent sign itself is encoded. Decide which part of your application is responsible for encoding and do it once. When decoding, similarly avoid repeated decoding unless the data format explicitly calls for it; decoding can turn an encoded separator back into a character with structural meaning.
A plus sign deserves special attention. This tool treats + as a literal plus when decoding. Some HTML form and query conventions use plus to represent a space, so check the format expected by your application before choosing a decoder. A literal plus is encoded here as %2B, and a space as %20.
Privacy and safe handling
This page processes input in your browser and does not submit it to the server. URL encoding is not encryption: encoded values remain readable after decoding. Avoid placing passwords, API keys, or personal data in URLs, which can be exposed through browser history, logs, or copied links. Use secure application channels for sensitive information.