URL Encoder / Decoder
Encode or decode URLs, query strings, and form data with UTF‑8 support, selective encoding, and live preview.
Mode: Encode · Charset: UTF‑8 · Client-side only
Quick examples
Reserved characters
Common encodings:
space → %20 or +? → %3F,
& → %26, = →
%3D
Developer tips
Use encodeURIComponent() for parameter values
and decodeURIComponent() when reading them.
How this URL encoder/decoder works
This tool converts text between normal (human-readable) form and percent-encoded form used in URLs and HTTP requests. It uses the same UTF‑8 encoding rules that modern browsers use.
When you click Encode, characters that are not
safe in URLs (such as spaces, quotes, and non‑ASCII characters)
are replaced with % followed by two hexadecimal
digits. When you click Decode, those sequences
are converted back to their original characters.
Encoding rules in a nutshell
For each character c in the input:
-
If
cis a letter (A–Z,a–z), digit (0–9), or one of- _ . ~, leave it as is. -
Otherwise, convert
cto its UTF‑8 byte sequence. -
For each byte
b, output%followed by the two‑digit uppercase hex value ofb.
Example: ✓ (U+2713) → UTF‑8 bytes
E2 9C 93 → %E2%9C%93
encodeURI vs encodeURIComponent
JavaScript provides two related functions:
-
encodeURI()– for a full URL. It does not encode reserved characters like:,/,?,#. -
encodeURIComponent()– for individual components (e.g. query parameter values). It encodes almost everything except letters, digits,- _ . ~.
Typical usage:
// Encode a query parameter value
const q = "hello world & coffee";
const url = "https://example.com/search?q=" + encodeURIComponent(q);
// https://example.com/search?q=hello%20world%20%26%20coffee
Common use cases
- Debugging long or nested URLs from logs or redirects.
- Encoding query parameters or form data before sending a request.
- Decoding callback URLs from OAuth, SAML, or other SSO flows.
- Bulk encoding/decoding lists of URLs (enable “Process each line separately”).
FAQ
What does a URL encoder/decoder do?
A URL encoder converts unsafe characters into a safe
representation using percent-encoding (for example, space →
%20). A decoder reverses this process and restores
the original text.
When should I encode vs. decode?
Encode when you are creating URLs or HTTP requests. Decode when you are reading or debugging existing URLs.
What about the “space as +” option?
In URL query strings and
application/x-www-form-urlencoded form data, spaces
are often represented as + instead of
%20. Turn on “Encode space as +” if you are working
with HTML forms or libraries that expect this behavior.
Is my data sent anywhere?
All encoding and decoding is done locally in your browser using JavaScript. The tool does not send your input to a server. Still, avoid using highly sensitive data on shared or untrusted devices.