URL Encoder
Encode & decode URL components and query strings
How to use URL Encoder
- Type or paste plain text in the top field to see the encoded version below.
- Or paste an already-encoded URL in the bottom field to see the decoded version.
- Choose 'Component' mode for encoding query parameters or path segments. Use 'Full URL' mode for encoding an entire URL.
- Click Swap to reverse the two fields, or Copy to copy either value to your clipboard.
What is URL encoding?
URL encoding (also called percent-encoding) replaces characters that have special meaning in a URL — or characters that are not safe for transmission — with a percent sign followed by two hexadecimal digits representing the character's byte value.
For example, a space becomes %20, an ampersand becomes %26, and a question mark becomes %3F. Unicode characters are encoded using their UTF-8 byte representation, so é (é) becomes %C3%A9.
URL encoding is essential when passing data in query parameters, path segments, or any URL component that might contain special characters. It prevents ambiguity and keeps URLs parseable.
Frequently Asked Questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI preserves characters that are part of a full URL structure (:, /, ?, &, =, #). Use it when you have a whole URL to encode. encodeURIComponent escapes those reserved characters too, making it suitable for query string values or URL path segments that should be treated as data.
What characters need to be URL-encoded?
Characters outside the unreserved set (A-Z, a-z, 0-9, -, _, ., ~) must be percent-encoded when they appear in URL components. Spaces become %20, & becomes %26, = becomes %3D, and so on. Non-ASCII characters are encoded using their UTF-8 byte sequence.
Why is my URL not decoding properly?
Common issues: malformed percent sequences (e.g., %ZZ or a % without two hex digits), plus signs that were used to represent spaces (application/x-www-form-urlencoded style — those need to be decoded as spaces first), or double-encoding (where characters were encoded twice and need two passes to decode).
Should I encode my whole URL before sharing?
Usually not. Most URLs produced by browsers or web frameworks are already correctly encoded. Only encode when you are constructing URL parts from user input or dynamic data that may contain special characters.