A URL encoder and decoder is a free online developer tool that instantly converts special characters in any text string into their percent-encoded equivalents safe for use in URLs — and decodes percent-encoded URL strings back into human-readable plain text — directly in your browser, with complete privacy and no server transmission required.
Every character that is not a letter, digit, or one of a small set of unreserved symbols carries special meaning in a URL — or simply cannot be transmitted safely through internet infrastructure without corruption. A space becomes %20. An ampersand becomes %26. A forward slash becomes %2F. This systematic replacement of unsafe characters with a percent sign followed by their two-character hexadecimal code is called percent encoding.
The algorithm is straightforward: for any character that is not an unreserved character, convert it to its UTF-8 byte representation, then represent each byte as % followed by two uppercase hexadecimal digits.
The unreserved characters (never percent-encoded): A–Z, a–z, 0–9, - _ . ~
| Character | Encoded | Character | Encoded |
|---|---|---|---|
| Space | %20 | & | %26 |
| ! | %21 | ' | %27 |
| " | %22 | / | %2F |
| # | %23 | : | %3A |
| $ | %24 | ; | %3B |
| % | %25 | = | %3D |
| + | %2B | ? | %3F |
| , | %2C | @ | %40 |
| Feature | Percent Encoding (RFC 3986) | Form Encoding |
|---|---|---|
| Standard | RFC 3986 | HTML specification |
| Space encoding | %20 | + |
| Plus sign | %2B | %2B |
| Used in | URL paths, general URIs | HTML form submissions |
| JavaScript | encodeURIComponent() | URLSearchParams |
A user searches for "C++ programming & algorithms". Before appending to a URL, it must be encoded:
Original: C++ programming & algorithms
Encoded: C%2B%2B%20programming%20%26%20algorithms
A web application redirects users with an encoded return URL parameter: ?redirect=https%3A%2F%2Fexample.com%2Fdashboard%3Ftab%3Dsettings. Decoding reveals the actual destination URL instantly.
HTML mailto links support pre-filled subject lines and email bodies — but both must be URL-encoded:
mailto:team@example.com?subject=Meeting%20Request%3A%20Q3%20Review%20%26%20Planning
A REST API call includes a date range parameter with special characters — colons, plus signs, and spaces in ISO 8601 datetime strings with timezone offsets all require encoding.
Digital marketers use UTM parameters to track campaign traffic. Campaign names, sources, and mediums frequently contain spaces and special characters that must be encoded:
utm_source=Email%20Newsletter&utm_campaign=Summer%20Sale%202025%20%E2%80%94%2030%25%20Off
Mistake 1: Encoding the entire URL instead of just the value. Encoding structural characters like ://, /, and ? destroys the URL structure and makes it unusable.
Mistake 2: Double encoding. Encoding an already-encoded string produces double-encoded output — %2520 instead of %20. Always check whether a value is already encoded before encoding it again.
Mistake 3: Forgetting to encode the percent sign itself. "50% off" must become 50%25%20off, not 50%%20off.
Mistake 4: Confusing + and %20 for spaces. In URL paths, spaces must always be %20. In query strings, servers may accept either + or %20.
💡 JavaScript has two URL encoding functions with very different scopes:
encodeURI() — encodes a complete URL, preserving structural characters (/, ?, #, &, =). Use when encoding a full URL.
encodeURIComponent() — encodes a URL component value, encoding EVERYTHING including structural characters. Use when encoding a parameter value.
Yes. This online URL encoder and decoder is 100% free with no registration, no subscription, and no payment required. Encode and decode as many URLs as you need.
No. A privacy-respecting URL encoder and decoder processes all input entirely within your browser using local JavaScript. Your data is never transmitted to any server, stored, or logged anywhere.
%20 is the percent-encoded representation of a space character. The % signals a percent-encoded sequence, and 20 is the hexadecimal value of the ASCII code for space (32 in decimal = 20 in hexadecimal).
URL encoding (percent encoding) replaces unsafe URL characters with %XX hex sequences, keeping the text human-readable and only slightly larger. Base64 encoding converts binary data into a completely different text representation using 64 safe characters, making the output unreadable but binary-safe. URL encoding is for making text safe in URLs; Base64 is for making binary data safe in text-based systems.
Two different standards handle spaces differently. RFC 3986 percent encoding — used for URL paths — represents spaces as %20. HTML form encoding (application/x-www-form-urlencoded) — used for query strings from HTML form submissions — represents spaces as +. Both are valid in their respective contexts, but mixing them causes subtle decoding errors.
Non-ASCII characters — international text, emoji, special symbols — require multiple bytes when encoded in UTF-8, and each byte is separately percent-encoded. A single emoji may require 4 UTF-8 bytes, producing 12 characters of percent-encoded output (%F0%9F%98%80). A Chinese or Arabic character typically produces 6–9 encoded characters.
No. HTML encoding (entity encoding) replaces HTML special characters with entity references (<, >, &) to prevent them from being interpreted as HTML markup. URL encoding replaces characters unsafe in URLs with percent-encoded sequences. Both are necessary in their respective contexts.
Use our free Free Online URL Encoder / Decoder — no signup, no download, works instantly on any device.
Open Free Online URL Encoder / Decoder — Free →