URL Encoder/Decoder: Encode Text for URLs & URIs
Percent-encode text for query strings and URI components. Decode encoded text back to readable format. UTF-8 support.
Try the free online tool mentioned in this guide:URL Encoder / Decoder
Why encode URLs?
URLs have reserved characters (?, &, =, #) that have special meaning. To include these in data (query strings, fragments), they must be percent-encoded:
hello world → hello%20world
user@example.com → user%40example.com
This ensures URLs are unambiguous and parseable.
Percent-encoding basics
Percent-encoding replaces special characters with % followed by a hex code:
- Space
=%20 - Hash
#=%23 - Ampersand
&=%26 - Equals
==%3D - At
@=%40
Non-ASCII characters (accents, emojis, etc.) are UTF-8 encoded then percent-encoded.
URL encoding in practice
Query string:
`
https://example.com/search?q=hello+world&sort=date
`
Here, hello+world is encoded (spaces as + or %20).
Fragment / Anchor:
`
https://example.com/page#section-with-spaces
`
Fragments are also percent-encoded for special chars.
Common encoding scenarios
- Search queries — user input with spaces and punctuation.
- API parameters — encoding user data sent as query strings.
- Email links — mailto: links with subject lines.
- File paths — spaces and special chars in file names.
Frequently asked questions
Is `+` or `%20` better for spaces?
In query strings, `+` is traditional but `%20` is more universal. Use `%20` for fragments and paths.
Do I need to encode the entire URL?
No, only encode the data portion (query values, fragment). The protocol and domain are left as-is.
What about international characters?
Encode as UTF-8 first, then percent-encode each byte. A tool does this automatically.

