How to use this calculator
- Enter or choose action.
- Enter or choose encoding for.
- Enter or choose text.
- The result updates as you type. Use Copy result or Share to keep it.
Method
Keep A–Z a–z 0–9 - . _ ~; replace every other character by the %XX hex code of each of its UTF-8 bytes.
- %XX
- a byte value in hexadecimal, e.g. space = %20, & = %26, é = %C3%A9
Worked example
- Letters a, b, c, d are unreserved and stay as they are.
- Space → %20, & → %26, = → %3D.
"a b&c=d" encodes to a%20b%26c%3Dd, safe to use as a single query value.
What the result means
Encode each query value separately, then join them with & and =. Encoding a whole URL with the component option would also escape the : / ? characters that give the URL its structure.
Assumptions and limits
- UTF-8 encoding, as specified for URLs by RFC 3986 and the WHATWG URL standard.
- The whole-URL option leaves reserved characters such as & and = untouched, so it cannot tell a literal & in a value from a separator.
Questions
Should a space be %20 or +?
Both appear. %20 is correct anywhere in a URL; + means space only in form-encoded query strings (application/x-www-form-urlencoded).
Why did decoding fail?
A % must be followed by two hex digits, and the bytes must form valid UTF-8. A stray % in the text should itself be encoded as %25.