About URL Encoder & Decoder
URLs can only contain a limited set of characters. Spaces, ampersands, equals signs, slashes and non-English letters have to be written as percent codes, for example a space becomes %20 and an ampersand becomes %26. This process is called URL encoding or percent-encoding.
The tool uses the same function as JavaScript encodeURIComponent(), which is the right choice for a single value such as a query parameter, a path segment or a redirect target. It encodes everything except letters, digits and - _ . ! ~ * ' ( ). To decode, switch the mode and paste the encoded text.
How to use URL Encoder & Decoder
- Select Encode or Decode.
- Paste the text or the encoded value into the input box and click Run Tool.
- Copy the result into your link, API request or code.
Example
Input
Learn PHP & MySQL: 100% free!
Output
Learn%20PHP%20%26%20MySQL%3A%20100%25%20free!
Common uses
- Building a query string value that contains spaces, ampersands or accented characters.
- Reading a long encoded redirect_uri or tracking parameter.
- Preparing text for a WhatsApp, mailto or search link.
Privacy and safety
This tool runs in your browser. The text you enter is processed on your device and is not sent to NHP Learning.
Frequently asked questions
Should I encode a whole URL with this tool?
Encode individual values, not the whole address. Encoding a full URL also encodes the colon and slashes, which breaks it. Encode each parameter value, then place it in the URL.
Is a space %20 or +?
This tool writes %20, which is valid everywhere. A + for a space is only valid in HTML form data (application/x-www-form-urlencoded), and the decoder does not convert + back to a space.
Why does decoding show an error?
A percent sign must be followed by two hexadecimal digits. A stray % in the text, such as "100%", makes the input invalid.