URL Encode/Decode
Encode or decode URL components instantly. Support for %20 and + encoding. Free online URL encoder and decoder.
URLs can only contain a limited set of characters defined by RFC 3986. Characters outside this set — including spaces, non-ASCII characters, and many punctuation marks — must be percent-encoded before they can appear safely in a URL. Percent encoding replaces each unsafe byte with % followed by the byte's two-digit hexadecimal value.
This is commonly needed when building query strings with dynamic values. For example, a search query like "hello world&more" would need to become hello%20world%26more before being appended to a URL. The & character is a query string delimiter, so leaving it unencoded would split what should be one parameter into two. The space would make the URL invalid in most parsers.
There are two common ways to encode spaces: %20 (the standard per RFC 3986) and + (used in HTML form encoding, application/x-www-form- urlencoded). This tool supports both. Use %20 when building URLs manually or in API calls. The + encoding is typically handled automatically by browser form submissions.
Use this tool to encode strings before embedding them in URLs, or to decode percent-encoded values you receive from an API, log file, or browser address bar. Encoding and decoding run entirely in your browser using JavaScript's encodeURIComponent() and decodeURIComponent() functions — no data is sent to any server.
Reserved vs unreserved characters
RFC 3986 splits URL characters into three groups. Unreserved characters (letters, digits, -, ., _, ~) never need encoding. Reserved characters have syntactic meaning (/, ?, #, [, ], @, !, $, &, ', (, ), *, +, ,, ;, =) and must be encoded when they appear as data rather than as delimiters. Everything else must be encoded.
encodeURI vs encodeURIComponent
JavaScript exposes two encoding functions, and picking the wrong one is a common source of bugs. encodeURI() assumes you are encoding a whole URL, so it leaves reserved characters (/, ?, #, &) alone. encodeURIComponent() assumes you are encoding a single query parameter value, so it encodes all reserved characters aggressively. This tool uses encodeURIComponent semantics — the right choice when you are building up URLs piece by piece.
Spaces: %20 or +?
Both represent a space, but they are not interchangeable. %20 works everywhere. + works only in the application/x-www-form-urlencoded content type (HTML form submissions). If you put + in a URL path, most parsers render it literally as a +. The safest rule: use %20 unless you are specifically targeting form encoding.
Double-encoding
A frequent bug: a value is encoded once by the client and encoded again by a framework or library on the way to the server. A space that started as %20 becomes %2520 (because % itself gets encoded as %25). If you see %25 sequences in production data, you probably have a double-encoding bug — decode once and check whether the result is the value you expected.