URL Encoder and Decoder
Encode and decode URLs online, including non-ASCII text and special characters
输出结果
About this tool
The URL encoder and decoder offers the three common modes used in front-end and back-end work:
- encodeURI: encodes a whole URL while keeping structural characters such as the scheme, slashes and question mark, which suits full links
- encodeURIComponent: encodes a parameter value and escapes most special characters, including slash, question mark and equals, which suits query values on both sides
- PHP urlencode: matches the PHP format and turns spaces into plus signs, for back ends written in PHP
When to use it
- Build API query strings with non-ASCII text and symbols
- Handle URLs that contain non-ASCII paths
- Escape values passed between front end and back end
- Decode an encoded parameter back into readable text
Switch between the three modes and convert both ways live, then copy the result in one click.
Mode comparison
| Mode | Spaces | Best for |
|---|---|---|
| encodeURI | Left as is | Encoding a whole URL |
| encodeURIComponent | Become %20 | Encoding a parameter value |
| PHP urlencode | Become + | PHP back ends |