URL Encoder
Percent-encode text for URLs: encodeURIComponent, strict RFC 3986, full URL (encodeURI) or form data with + for spaces. UTF-8 correct, in-browser.
42 characters · 47 bytes (UTF-8)
0 characters · 0 bytes (UTF-8)
Runs entirely in your browser. Your data is never uploaded.
What is URL Encode?
Converts text to percent-encoding so it can be used safely in URLs. Characters outside the allowed set are encoded as their UTF-8 bytes, each written as %XX. Four modes match the encoders developers actually use.
How to use URL Encode
- Type or paste text into Input.
- Choose the Encoding mode: Component for a query value or path segment, Strict RFC 3986, Full URL to keep
: / ? & =, or Form data forapplication/x-www-form-urlencoded. - Copy the encoded string from Output.
Example
a b&c=é
a%20b%26c%3D%C3%A9
Component mode. Form mode gives a+b%26c%3D%C3%A9.
When to use URL Encode
Use Component mode for individual parameter values – never encode a complete URL with it, because /, ? and & would be encoded too. Use Full URL mode only for a URL that is already correctly structured. HTML form submissions and many server frameworks expect Form mode.
How URL Encode works
The text is converted to UTF-8 bytes. Bytes that are in the safe set of the selected mode are kept; all others become % followed by two uppercase hex digits. Component mode keeps A–Z a–z 0–9 - _ . ! ~ * ' ( ) (like JavaScript encodeURIComponent); RFC 3986 mode keeps only A–Z a–z 0–9 - . _ ~; Full URL also keeps ; , / ? : @ & = + $ # (like encodeURI); Form mode keeps A–Z a–z 0–9 * - . _ and writes spaces as + (like URLSearchParams).
Common Use Cases
- Encoding a search term or redirect URL as a query parameter
- Building OAuth or API signature base strings (RFC 3986 mode)
- Preparing form bodies for
curl -d - Encoding non-ASCII paths such as Vietnamese or Chinese slugs
FAQs
Should spaces be %20 or +?
%20 is valid everywhere in a URL. + means space only in form-encoded query strings; choose Form data mode for that.
What is the difference between encodeURI and encodeURIComponent?
encodeURI keeps characters that structure a URL (: / ? # & =), while encodeURIComponent encodes them so the value cannot break the URL structure.
Why does é become two codes?
URLs use UTF-8: é is the two bytes C3 A9, each written as %XX.