URL Encoder
Encode text and URLs into percent-encoded format.
Was this tool helpful?
Thanks for the feedback!
URL Encoder converts text into percent-encoded form so that spaces, ampersands, rupee signs, Hindi words and other special characters can travel safely inside a web address. It is mainly for the values you insert into a link, such as a search term, a pre-filled message or a return address passed as a parameter.
Which characters change
The tool applies JavaScript's encodeURIComponent. Letters A–Z and a–z, digits, and the characters - _ . ! ~ * ' ( ) are left alone. Everything else is first converted to UTF-8 bytes, and each byte is written as a percent sign followed by two hexadecimal digits, the percent-encoding scheme defined in RFC 3986.
| Character | Encoded | Why it matters |
|---|---|---|
| space | %20 | Spaces aren't allowed in URLs |
| & | %26 | Separates parameters |
| = | %3D | Separates name and value |
| / | %2F | Separates path segments |
| ? | %3F | Starts the query string |
| ₹ | %E2%82%B9 | Three bytes in UTF-8 |
Worked example
Encoding masala dosa & chai = ₹120 returns:
masala%20dosa%20%26%20chai%20%3D%20%E2%82%B9120
Appended to https://example.com/search?q=, the whole phrase arrives as one value. Without encoding, the server would read q=masala dosa and then treat chai as the start of a second, broken parameter.
Encode the value, not the whole URL
This is the most common mistake. Because the tool also encodes colons, slashes and question marks, pasting a complete address such as https://example.com/?q=a b returns https%3A%2F%2Fexample.com%2F%3Fq%3Da%20b, which no longer works as a link. That output is right only when the entire URL is itself a parameter value, for instance the destination inside ?redirect=. Otherwise, encode just the pieces you're inserting and build the link around them.
%20 or a plus sign for spaces?
HTML forms using the classic application/x-www-form-urlencoded format write spaces as +, whereas this tool writes %20. Servers generally accept %20 in query strings, and it is the only correct choice in the path part of a URL, which makes it the safer default. If a particular system insists on plus signs, replace %20 with + after encoding.
Places where encoding saves you trouble
- WhatsApp and SMS links with pre-filled messages; the WhatsApp Link Generator handles this step automatically.
- Campaign values that contain spaces, such as a campaign named "diwali sale".
- API calls where a parameter holds an email address (the @ becomes
%40) or a time zone offset:+05:30must be sent as%2B05%3A30, or the server will read the plus as a space.
Getting the same result in code
- JavaScript:
encodeURIComponent(value)matches this tool exactly.encodeURI()is a different function that leaves: / ? & = #alone and is meant for complete URLs. - PHP:
rawurlencode()writes spaces as%20and also encodes! * ' ( );urlencode()writes spaces as+. - Python:
urllib.parse.quote(value, safe='')gives%20for spaces, whilequote_plus()gives+.
To reverse the process, paste encoded text into the URL Decoder.