URL Encoder / Decoder
Encode or decode URLs and special characters instantly.
URLs have strict rules about which characters are allowed. Spaces, ampersands, question marks, and non-ASCII characters must be percent-encoded to pass safely through browsers, servers, and APIs. This tool encodes and decodes URL components instantly, helping you debug query strings, build API requests, and troubleshoot broken links.
How to Encode and Decode URLs
- Encode a full URL — paste a complete URL and click "Encode URL" to make it safe for transport while preserving URL structure characters (/, ?, =, &).
- Encode a URL component — use "Encode Component" for a single value like a query parameter that may contain /, ?, = or & that need escaping.
- Decode a URL — paste a percent-encoded string (e.g.
hello%20world) and click "Decode URL" to get back the original text. - Copy the result — click Copy to copy the output.
Worked Example: Encoding a URL Inside a Query Parameter
The classic mistake: passing a URL as a query parameter without encoding it. Say you want to redirect to https://example.com/page?id=42&lang=en after login:
Wrong (raw URL in the parameter):
https://myapp.com/login?next=https://example.com/page?id=42&lang=en
The server sees lang=en as a parameter of myapp.com, not of the redirect target — the redirect breaks.
Right (encode the component first):
https://myapp.com/login?next=https%3A%2F%2Fexample.com%2Fpage%3Fid%3D42%26lang%3Den
Use Encode Component for the inner URL (it escapes / ? = &), and Encode URL only when encoding a full URL whose structure must stay intact.
URL Encoding Reference Table
The characters most often encoded, per RFC 3986:
| Character | Encoded | Character | Encoded |
|---|---|---|---|
| space | %20 | / | %2F |
! | %21 | : | %3A |
" | %22 | ; | %3B |
# | %23 | = | %3D |
$ | %24 | ? | %3F |
% | %25 | @ | %40 |
& | %26 | [ | %5B |
' | %27 | ] | %5D |
+ | %2B | , | %2C |
Never encoded (unreserved): A–Z a–z 0–9 - _ . ~