The right encoding for every part of a URL
Characters like spaces, &, ?, # and non-English letters have special meanings in URLs or aren't allowed at all, so they must be percent-encoded (a space becomes %20, ₹ becomes %E2%82%B9). Choosing the wrong mode is a classic bug, so the encoder offers three:
Query value / component (encodeURIComponent) encodes everything that could break a parameter — use it for search terms and values. Whole URL (encodeURI) keeps :/?#&= so the link still works. Form data uses + for spaces, matching how HTML forms submit. You can also encode each line separately to prepare lists of values.
How to URL-encode text
- 1
Pick what you're encoding
A value, a whole URL or form data.
- 2
Paste the text
Encoding happens as you type.
- 3
Copy the result
Or swap to decode it again.
Key features
Three encoding modes
Component, full URL and form data.
UTF-8 correct
Matches what browsers send.
Line-by-line option
Encode many values at once.
Private
Runs in your browser.
Common uses
- Building API requests: Encode search terms and filter values.
- Tracking links: Encode UTM values and redirect URLs.
- Sharing links: Make URLs with spaces or special characters work everywhere.
Tips and good to know
- Encoding a URL that goes inside another URL (like a redirect parameter)? Use the component mode on the inner URL.
- To see a URL's parts and parameters clearly, use the URL Parser.
