What is URL encoding?
URL encoding, also called percent-encoding, replaces characters that are not allowed or have a special meaning in a URL with a percent sign and two hexadecimal digits, for example a space becomes %20. This URL encoder and decoder works in two modes: component mode, like encodeURIComponent, for query values, and full-URL mode, like encodeURI, which keeps the URL structure. It also lists query-string parameters in a table. Everything runs in your browser.
How to encode or decode a URL
- 1
Choose Encode or Decode.
- 2
Select “Component” to encode a single value, or “Full URL” to keep characters such as : / ? & = intact.
- 3
Paste your text or URL. The result appears immediately.
- 4
Check the parameter table to see each query-string key and its decoded value.
Key features
Component and full URL modes
Match JavaScript’s encodeURIComponent for values or encodeURI for whole addresses, with the same decoding rules.
Query-string table
Paste a URL or query string and see its protocol, host, path and every parameter decoded in a table.
Plus as space
Switch on form encoding (application/x-www-form-urlencoded) to treat + as a space when decoding or write spaces as + when encoding.
UTF-8 correct
Accented letters, emoji and non-Latin scripts are encoded as UTF-8 byte sequences, as required by modern URLs.
Frequently asked questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI keeps characters that structure a URL, such as : / ? # & and =, and is meant for whole URLs. encodeURIComponent encodes those too and is meant for a single value, such as a query parameter.
Why does a space become %20 or +?
In a URL path, a space is %20. In HTML form submissions (application/x-www-form-urlencoded) spaces are written as +. Both are decoded to a space in a query string.
Which characters never need encoding?
Letters, digits and the characters - _ . ~ are unreserved and are never percent-encoded.
Why do I get a “malformed” error when decoding?
A percent sign must be followed by two hexadecimal digits that form a valid UTF-8 sequence. A stray % or a truncated sequence such as %E9 on its own cannot be decoded.
How do I decode a URL query string?
Paste the URL into the input. The table below lists each parameter with its decoded value, and the output panel shows the whole text decoded.