URL Encoder and Decoder
Percent-encode and decode URL text online. Convert special characters to %xx form with encodeURIComponent or encodeURI, decode encoded strings back, and handle Unicode characters correctly.
FreeOnline Tool
Loading…
How to Use
- Type or paste the text or URL fragment you want to encode into the input box.
- Click "Encode" to convert special characters into %xx form.
- Or paste an already encoded string and click "Decode" to restore the original characters.
- Choose whether to encode a whole URL or only a query parameter value.
- Click the copy button to take the result.
Features
- Two encoding modes: component encoding (encodeURIComponent) and full URL encoding (encodeURI)
- Decoding with decodeURIComponent and decodeURI
- Correct UTF-8 handling for Chinese, emoji and other Unicode characters
- Converts in real time as you type
- One-click copy of the result
Use Cases
Building URLs with non-ASCII parameters
Encode parameter values such as Chinese search terms or titles so the resulting URL is valid and works across browsers.
Encoding API request parameters
When assembling a query string by hand, encode values containing &, = or + so the server parses the parameters correctly.
Reading an encoded address bar URL
Decode a %xx heavy URL from the browser address bar back into readable text for inspection and debugging.
Web scraping and data collection
Decode collected URLs to extract keywords and parameters, or encode the request URLs you construct correctly.
FAQ
What is the difference between encodeURI and encodeURIComponent?
encodeURI is for a complete URL and preserves structural characters such as :, /, ? and #. encodeURIComponent is for a single piece of a URL, such as a query parameter value, and encodes more characters including / and ?.
Why is a space sometimes %20 and sometimes +?
%20 is the standard percent-encoded representation of a space. The + form comes from HTML form encoding (application/x-www-form-urlencoded) and applies only to query strings, never to the path.
How are Chinese characters encoded?
They are first encoded as a UTF-8 byte sequence, and each byte is then written as %xx. For example the two characters in "你好" become %E4%BD%A0%E5%A5%BD, six bytes shown as twelve characters.
Does every special character need encoding?
No. Some characters are allowed unencoded in a URL, including - _ . ! ~ * ' and parentheses. Only characters outside that set need encoding; RFC 3986 defines the exact rules.