Free · No sign-up · Private
URL Encoder
Percent-encode text for safe use in a URL.
Quick answer
Type text and every character that is not safe in a URL is replaced with % followed by its UTF-8 byte in hex. A space becomes %20, & becomes %26 and ? becomes %3F, so “hello world & friends?” becomes hello%20world%20%26%20friends%3F.
hello%20world%20%26%20friends%3FStep by step
How to use the URL Encoder
01
Enter text to encode.
02
See the percent-encoded output.
03
Copy the result.
Worked examples
Common encodings
| Character | Encoded |
|---|---|
| space | %20 |
| & | %26 |
| ? | %3F |
| / | %2F |
| = | %3D |
| é | %C3%A9 |
Good to know
Encoding a query value
Use this for one value at a time, such as a search term in ?q=. Encoding a whole URL this way would also encode the slashes and colon, breaking it.
%20 or +?
In query strings submitted by HTML forms, spaces are often written as +. %20 works everywhere, which is why encodeURIComponent uses it.
encodeURIComponent versus encodeURI
JavaScript has two functions. encodeURIComponent, used here, encodes every reserved character, including / ? & = and #, so it is right for a single query value or path segment. encodeURI leaves those characters alone so a complete URL keeps working. Using the wrong one is a common cause of broken links and of parameters that arrive split in two on the server.
Encoding non-English text
Characters outside ASCII are first turned into UTF-8 bytes, and each byte becomes a %XX sequence. “café” becomes caf%C3%A9 and an emoji becomes four sequences. Servers decode them back automatically, so search terms and names in any language work in links.
FAQ
Frequently asked questions
Which characters are left alone?
Letters, digits and - _ . ! ~ * ' ( ).
How do I decode it?
Use the URL decoder.
More developer tools
Related tools
URL Decoder
Decode percent-encoded URLs back to readable text.
Open toolJWT Decoder
Decode a JSON Web Token and inspect its header and payload.
Open toolUnix Timestamp Converter
Convert between Unix timestamps and human-readable dates.
Open toolRegex Tester
Test a regular expression against text and see all matches highlighted.
Open tool