URL Encoder/Decoder
Encode or decode URLs and query parameters. Handles percent-encoding for safe URL transmission.
How to use
- 1 Select Encode to make a string safe for use in a URL query string, or Decode to read a percent-encoded URL.
- 2 Paste your input text or URL into the field.
- 3 The result appears instantly.
- 4 Click Copy to use it in your links, API calls, or form data.
Key features
- Encodes special characters for safe use in URL query strings
- Decodes percent-encoded strings back to readable text
- Handles full URLs and individual parameter values
- Instant real-time conversion
What is URL Encoding?
URL encoding (also called percent encoding) replaces characters that are unsafe or reserved in a URL with a % followed by two hexadecimal digits representing the character's byte value. A space becomes %20, an ampersand becomes %26.
URLs can only carry a limited set of characters. Any character outside the unreserved set (A–Z, a–z, 0–9, -, _, ., ~) must be percent-encoded per RFC 3986.
Common Use Cases
Encoding query parameters
Encode values before appending them to a URL — especially when values contain &, =, or special characters.
Internationalized URLs
Encode non-ASCII characters (like Chinese, Arabic, or accented letters) found in paths or query strings.
Debugging malformed URLs
Decode a URL that arrived percent-encoded to read its actual query parameters and path segments.
Building API request URLs
Encode search terms, filters, or IDs before passing them as query parameters to REST endpoints.
Mailto and tel links
Encode subject lines and body text for mailto: links so spaces and special characters work correctly.
E-commerce redirects
Encode the "redirect_after_login" URL so it survives being passed as a query parameter value.
encodeURI vs encodeURIComponent
JavaScript provides two built-in functions for URL encoding. Knowing which to use matters — using the wrong one is a common bug.
| Function | Does NOT encode | Use it for |
|---|---|---|
| encodeURI() | : / ? # [ ] @ ! $ & ' ( ) * + , ; = | Encoding a full URL while preserving its structure |
| encodeURIComponent() | A–Z a–z 0–9 - _ . ~ | Encoding individual query parameter values |