Tools

Free Online URL Encoder & Decoder

Encode text to percent-encoded URLs or decode %20, %26 and any %XX sequence — instantly in your browser.

0 chars
Copied!
0 chars

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.

Input: hello world & more
Output: hello%20world%20%26%20more

encodeURI()

Use for a complete URL string. Preserves structural characters like / : ? # & = @ so the URL remains valid.

Input: https://site.com/path?q=hello world
Output: https://site.com/path?q=hello%20world

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

%20 is the percent-encoded form of a space used by both encodeURIComponent and encodeURI. The + sign represents a space only in the application/x-www-form-urlencoded format (HTML form GET submissions). This tool decodes both: %20 and + are both treated as spaces in Decode mode.

Use encodeURIComponent for individual parameter values inside a query string — for example, the search term in ?q=hello+world. Use encodeURI when you need to encode an entire URL without breaking its structure: encodeURI preserves /, ?, #, &, =, @, and : so the URL stays valid.

Yes. This tool attempts to decode all valid %XX sequences it finds and leaves any invalid or unrecognised sequences in place, showing a warning. This is useful for debugging URLs that were only partially encoded.

No. URL encoding (percent-encoding) converts unsafe characters to %XX sequences so they can appear safely in a URL. Base64 encoding converts binary data into a printable ASCII string. They serve completely different purposes and are not interchangeable.

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.