Encoding
Percent-encode text for URLs
URL encoding (percent-encoding) replaces unsafe characters with a % sign plus two hex digits, so text can travel inside URLs without breaking their syntax. Developers encode query values, redirect targets, and user input before embedding them in links or fetch calls. This tool applies encodeURIComponent rules: spaces become %20 (never +), UTF-8 is handled, and characters like :, /, and ? are escaped because the input is one component. Output updates as you paste.
How to use URL Encode
- Open URL Encode in the Toolbox101 app.
- Paste the string to percent-encode (a query value, redirect target, or user-supplied input) into the Input box.
- Read the encoded output in the Output box; it updates on every keystroke.
- Click Copy and paste the encoded value into your link, curl command, or source code.
Worked example
URL Encode returns the output below for this input.
Input
q=hello world&lang=enOutput
q%3Dhello%20world%26lang%3DenCheck it yourself: open URL Encode and enter the same input.
Frequently asked questions
What is the difference between encodeURIComponent and encodeURI?
encodeURIComponent escapes everything except letters, digits, and - _ . ! ~ * ' ( ), including : / ? & = #. It encodes a single component. encodeURI is meant for a whole URL and leaves those reserved characters intact. This tool implements encodeURIComponent semantics, so a full address pasted here gets its scheme and slashes escaped; encode each segment separately instead.
Why is a space encoded as %20 instead of +?
%20 is the standard percent-encoding of a space, and it is what encodeURIComponent emits: this tool never produces +. The plus-for-space convention belongs to HTML form encoding, a different scheme that some server-side parsers apply to query strings. %20 decodes to a space in both conventions, so it is safe everywhere.
Does URL encoding handle UTF-8 and emoji?
Yes. encodeURIComponent converts input to UTF-8 before escaping, so multi-byte characters become several %XX pairs: the euro sign encodes as %E2%82%AC and an emoji as four escapes. The resulting string is pure ASCII, which makes it safe to embed in URLs and query strings regardless of the original characters.
Why is my entire URL encoded, slashes included?
Because the tool treats the whole input as one component, which is what encodeURIComponent does. A slash, colon, or question mark is only safe inside a URL when it is structural; as component content it must be escaped to survive. Encode each path segment and each query value separately, and build the URL around the encoded parts.