Free Online URL Encoder & Decoder
Encode text to percent-encoded URLs or decode %20, %26 and any %XX sequence — instantly in your browser.
Encoding Reference Examples
| Input | encodeURIComponent | encodeURI |
|---|---|---|
| hello world | hello%20world | hello%20world |
| name=John&age=30 | name%3DJohn%26age%3D30 | name=John&age=30 |
| https://example.com/path?q=hi | https%3A%2F%2Fexample.com%2Fpath%3Fq%3Dhi | https://example.com/path?q=hi |
| café résumé | caf%C3%A9%20r%C3%A9sum%C3%A9 | caf%C3%A9%20r%C3%A9sum%C3%A9 |
| price: $9.99 (sale!) | price%3A%20%249.99%20(sale!) | price%3A%20%249.99%20(sale!) |
What Is URL Encoding?
URL encoding (also called percent-encoding) is a mechanism for converting characters that are not safe in a URL into a percent sign followed by two hexadecimal digits. For example, a space becomes %20, an ampersand becomes %26, and an equals sign becomes %3D.
Browsers and servers require this encoding because URLs can only contain a limited set of ASCII characters. Any character outside this safe set — including spaces, accented letters, Chinese characters, and special symbols — must be encoded before being included in a URL.
encodeURIComponent vs encodeURI
JavaScript provides two native functions for URL encoding. Choosing the right one depends on what you are encoding.
encodeURIComponent()
Use for individual query-string values. Encodes everything except letters, digits, and - _ . ! ~ * ' ( ). Encodes / : ? # & = @ as well.
encodeURI()
Use for a complete URL string. Preserves structural characters like / : ? # & = @ so the URL remains valid.
Common URL Encoding Use Cases
Percent-encoding appears everywhere in modern web development and APIs.
Search & Query Parameters
Encode user-supplied search terms before appending them to a GET request so special characters do not break the query string.
API Calls with Dynamic Values
REST and GraphQL APIs often require values in path segments or parameters to be percent-encoded to avoid ambiguity.
OAuth & Redirect URLs
OAuth 2.0 redirect_uri parameters must be fully encoded so the authorisation server can parse the callback address correctly.
Non-ASCII Slugs
URLs for pages in Arabic, Chinese, Japanese or accented Latin scripts must be percent-encoded for maximum compatibility across browsers and crawlers.
HTML Form GET Submissions
Browsers encode form fields before appending them to the action URL. Understanding this encoding helps debug unexpected %2B or %20 sequences.
Frequently Asked Questions
Privacy
All encoding and decoding happens entirely inside your browser using native JavaScript functions. Your text is never sent to our servers, stored, or logged. Once you close the tab, every trace of the input is gone.