URL Encoder & Decoder — Percent-Encode URLs Online
This free URL encoder and decoder converts text to and from percent-encoding so it travels safely inside a URL. Reserved and unsafe characters — spaces, ampersands, question marks, and non-Latin letters — must be encoded as a percent sign followed by their hex byte value, or a query string can break. It mirrors JavaScript's encodeURIComponent for values and encodeURI for whole URLs, the distinction that trips most developers. Everything runs locally in your browser, so the data you encode is never uploaded.
How URL encoding works
URL encoding (also called percent-encoding) converts characters that are not allowed or have special meaning in URLs into a safe format. Each unsafe character is replaced by a percent sign (%) followed by its two-digit hexadecimal ASCII code. For example, a space becomes %20, the # symbol becomes %23, and & becomes %26.
This tool uses JavaScript's encodeURIComponent(), which encodes everything except A–Z, a–z, 0–9, and the characters - _ . ! ~ * ' ( ). This is the correct function for encoding individual query parameters or path segments. The related function encodeURI() is less strict and preserves characters like / ? # & that have structural meaning in a full URL. Decoding uses the corresponding decodeURIComponent(). Double-encoding is a common mistake — encoding an already-encoded string turns %20 into %2520, which breaks URLs. Always decode first if your string might already be encoded.