Tech & Digital
URL Encoder and Decoder (Percent-Encoding)
Encode or decode text for use in web addresses. URLs may only contain a limited set of characters: letters, digits and a few symbols. Spaces, accented letters, non-Latin scripts and characters that have a special meaning in URLs, such as ?, &, = and #, must be converted into a safe form before they can appear in a link or a query string. This conversion is called percent-encoding, or URL encoding, and is defined by the internet standard RFC 3986: each byte of the text, first converted to UTF-8, is written as a percent sign followed by two hexadecimal digits, so a space becomes %20 and é becomes %C3%A9. Developers need it when building links with search parameters, calling web APIs, generating tracking links and debugging redirects; marketers and analysts meet it in campaign URLs and analytics reports, where decoding makes long encoded addresses readable again. There are two common modes. When encoding a single query value or path segment, every reserved character is encoded so it cannot break the URL. When encoding a whole URL, the characters that give it structure, such as the colon, slashes, question mark and ampersand, are kept. Choose encode or decode, pick the mode and paste your text. The decoder also turns plus signs from HTML forms back into spaces. Everything runs in your browser.
How to use this calculator
- Choose encode or decode.
- For encoding, choose a query value or a full URL.
- Paste the text or URL.
- Copy the result.
- Use decode to read encoded links and parameters.
When to encode
Encode each parameter value separately before joining them with & and =. Encoding the whole query string at once would also encode the separators and break it.
Double encoding is a common bug: if %20 appears as %2520, the text was encoded twice.
Internationalised addresses
Browsers display non-ASCII characters in addresses for readability but send them percent-encoded. Domain names use a separate system called Punycode, beginning with xn--.
When sharing links in emails or documents, using the encoded form avoids broken links in older software.
Formula & method
Percent-encoding replaces a byte with % followed by two hexadecimal digits, as defined in RFC 3986Text is first converted to UTF-8 bytes, so é becomes %C3%A9Unreserved characters A–Z a–z 0–9 - . _ ~ are never encodedIn HTML form data, spaces may appear as + instead of %20; the decoder accepts bothPercent-encoding (RFC 3986): each byte outside the allowed set is written as %HH, where HH is its value in hexadecimal. Text is converted to UTF-8 first, so characters beyond ASCII become several encoded bytes, for example € = %E2%82%AC. Unreserved characters, A–Z, a–z, 0–9, hyphen, period, underscore and tilde, are never encoded. Query-value mode encodes all reserved characters, including : / ? # [ ] @ ! $ & ' ( ) * + , ; =. Full-URL mode keeps the reserved characters that structure a URL and encodes spaces and other unsafe characters. In application/x-www-form-urlencoded data, spaces may be sent as +; the decoder converts + to a space.
Worked example
Encoding “a b&c” as a query value
- The space becomes %20.
- The ampersand becomes %26, so it is not read as a parameter separator.
- Letters stay unchanged.
Answer: a%20b%26c
Frequently asked questions
What is URL encoding?
Replacing unsafe characters with % followed by two hexadecimal digits.
Why is a space %20?
Because 20 is the hexadecimal code of the space character.
What is the difference between %20 and +?
Both can mean a space; + is used in HTML form data.
Which characters are never encoded?
Letters, digits, hyphen, period, underscore and tilde.
How are accented letters encoded?
As their UTF-8 bytes, such as %C3%A9 for é.
Is my text sent to a server?
No, encoding runs in your browser.