EthicalFusion

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.

CharacterEncodedWhy it matters
space%20Spaces aren't allowed in URLs
&%26Separates parameters
=%3DSeparates name and value
/%2FSeparates path segments
?%3FStarts the query string
₹%E2%82%B9Three 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:30 must 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 %20 and also encodes ! * ' ( ); urlencode() writes spaces as +.
  • Python: urllib.parse.quote(value, safe='') gives %20 for spaces, while quote_plus() gives +.

To reverse the process, paste encoded text into the URL Decoder.

Frequently asked questions

Why does the encoder turn https:// into https%3A%2F%2F?
It encodes every reserved character, including colons and slashes. Encode only the value you are adding to a link, unless the whole URL is meant to be a parameter value.
Does the URL encoder use %20 or + for spaces?
It uses %20, which works in both paths and query strings. Switch to + only if a system specifically asks for form-style encoding.
How are Hindi characters and emojis encoded?
They are converted to UTF-8 bytes and each byte becomes a %XX code. A Devanagari letter takes three bytes and most emojis take four.
Which characters are left unencoded?
Letters, digits and the characters - _ . ! ~ * ' ( ) stay as they are. Everything else is percent-encoded.
Is URL encoding a kind of encryption?
No. Anyone can decode it instantly. It only makes characters safe to include in a web address.

Related tools

Embed this tool on your site

Paste it into any blog or website. Free, with a credit link.