Escape a single URI component – a query value, path segment or fragment – so reserved characters like ampersand, equals, question mark, slash and hash cannot break the surrounding URL. Strict RFC 3986 mode also escapes the exclamation mark, apostrophe, parentheses and asterisk.
Show calculation steps
Processed privately in your browser — nothing you paste is uploaded, logged or stored.
Encoding a value, not a URL
A component encoder escapes every character that has structural meaning in a URL, including / ? & = and #. That is the right behaviour for a value going inside a URL — a search term, a redirect target, a filename — because inside a value those characters are data rather than punctuation.
Worked example
value: a&b=c component encoding → a%26b%3Dc correct full-URI encoding → a&b=c unchanged, breaks the query
The mistake this prevents
Using a full-URI encoder on a value leaves the ampersand alone, so the receiving server reads one parameter as two and the value is silently truncated at the ampersand. It is a bug that only appears when a user types a character nobody tested with, which is why it reaches production so often.
Nesting URLs
A URL passed as a parameter to another URL must be component-encoded, and if it is passed twice it must be encoded twice. Under-encoding here is a common cause of broken redirect and OAuth callback flows.
Limits
Encoding is not sanitisation: a component-encoded value is safe to place in a URL and is not thereby safe to place in HTML or SQL. Those need their own escaping. Everything runs in your browser.
How to use the URI Component Encoder
- Paste the single value you need to embed – a search term, a redirect target, a filename.
- Choose the standard: encodeURIComponent matches JavaScript exactly; strict RFC 3986 additionally escapes four characters that JavaScript leaves alone.
- Click "Encode component" and paste the result into your URL.
Frequently asked questions
How is this different from the URL Encoder?
This tool always behaves like encodeURIComponent: it escapes every reserved character, including the colon, slashes, question mark, ampersand and hash. That is what you want for a value going inside a URL. The URL Encoder additionally offers a whole-URL mode that preserves those structural characters.
Why does strict mode escape the apostrophe, parentheses and asterisk?
RFC 3986 classifies those as sub-delimiters that may carry meaning in some schemes, but JavaScript’s encodeURIComponent leaves them unescaped for historical reasons. Strict mode closes that gap, which some server frameworks and signature schemes require.
I pasted a full URL and everything got escaped. Is that a bug?
No – it is the correct behaviour for this tool, and it is right when you are embedding one URL inside another (a redirect parameter, for example). If you simply wanted a valid version of that URL, use the URL Encoder in whole-URL mode. The tool warns you when it detects this situation.
Build a URL with parameters
A query string whose values are encoded correctly, including the awkward characters.
- URI Component Encoder you are hereEncode each value on its own, so separators inside values survive.
- Query String BuilderAssemble the encoded values into a query string.