Free URL Encoder & Decoder — Encode URLs Online
Table of Contents
URLs can only contain a limited set of characters. Spaces, special characters, and non-ASCII text need to be converted to a safe format before they can appear in a URL. This process — replacing unsafe characters with percent-encoded equivalents — is URL encoding. A space becomes %20, an ampersand becomes %26, and a plus sign becomes %2B.
Our free URL encoder converts any text to a URL-safe format instantly. Paste text and encode it for use in URLs, query parameters, API calls, and redirects. You can also decode percent-encoded URLs back to readable text.
What Is URL Encoding?
URL encoding (also called percent-encoding) replaces unsafe ASCII characters with a percent sign followed by two hexadecimal digits representing the character's byte value. The space character (ASCII 32) becomes %20 because 32 in hexadecimal is 20.
This is defined by RFC 3986 and is fundamental to how the web works. Every time you search Google, the spaces in your query are encoded. Every time you click a link with parameters, the values are encoded. URL encoding is invisible infrastructure that makes the internet function.
Why URL Encoding Matters
URLs use certain characters for structural purposes: / separates path segments, ? starts query parameters, & separates parameters, = assigns values. If your data contains these characters, they must be encoded to prevent the browser from interpreting them as URL structure instead of URL content.
Example: Without encoding, the URL ?name=Tom & Jerry would break because & is interpreted as a parameter separator and the space is invalid. Encoded: ?name=Tom%20%26%20Jerry.
Common URL Encodings
| Character | Encoded | Why |
|---|---|---|
| Space | %20 or + | Not allowed in URLs |
| & | %26 | Used as parameter separator |
| = | %3D | Used for key=value assignment |
| ? | %3F | Used to start query string |
| # | %23 | Used for fragment/anchor links |
| / | %2F | Used as path separator |
| + | %2B | Sometimes interpreted as space |
| @ | %40 | Used in email addresses |
When You Need URL Encoding
- Building API URLs. Query parameters with user input must be encoded. Passing
city=San Franciscorequires encoding the space. - Redirect URLs. When a URL is passed as a parameter to another URL, the inner URL must be fully encoded.
- UTM parameters. Marketing campaign URLs with spaces or special characters in UTM values need encoding to work correctly in analytics.
- Debugging broken links. Decoding a percent-encoded URL reveals what the original text was, helping you identify why a link isn't working.
- Email links. Subject lines and body text in mailto: links must be URL-encoded.
Frequently Asked Questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URL but preserves structural characters like /, ?, and #. encodeURIComponent encodes everything including those structural characters. Use encodeURIComponent for encoding individual parameter values, and encodeURI for encoding complete URLs.
Should spaces be encoded as %20 or +?
In URL path segments, use %20. In query strings (application/x-www-form-urlencoded), + is also valid for spaces. %20 works everywhere and is the safer default.
Does this handle Unicode characters?
Yes. Non-ASCII characters like Chinese, Japanese, emoji, and accented letters are encoded using their UTF-8 byte sequences. Each byte is individually percent-encoded.
Why do I see %20 in some URLs and + in others?
Both represent spaces. %20 is the standard URL encoding (RFC 3986). The + convention comes from HTML form submission (application/x-www-form-urlencoded). Modern best practice is to use %20.
Is my data private?
Yes. All encoding and decoding happens in your browser. Nothing is transmitted to any server.
Try the URL Encoder Now
Free, instant, no signup. Your data never leaves your browser.
Open URL Encoder
