URL Encoder / Decoder
DataEncode special characters in URLs using percent-encoding, or decode percent-encoded URLs back to plain text. Free, instant, client-side — nothing is uploaded.
What is a URL Encode?
A URL Encoder / Decoder converts text to and from percent-encoding — the mechanism defined in RFC 3986 for safely embedding arbitrary characters in a URL. URLs may only contain a restricted set of characters: unreserved characters (letters, digits, -, _, ., ~) and a fixed set of reserved characters that carry structural meaning (:, /, ?, #, [, ], @, !, $, &, ', (, ), *, +, ,, ;, =). Any other character — spaces, accented letters, symbols — must be percent-encoded by replacing each byte with %XX, where XX is the byte's hexadecimal value.
This tool exposes two encoding functions used in JavaScript and every web platform:
- encodeURIComponent — encodes a single URL component (a query parameter value, a path segment). Encodes everything except letters, digits, and
- _ . ! ~ * ' ( ). Use this for data values within a URL. - encodeURI — encodes a complete URI while preserving its structural characters (
:,/,?,#,&,=, etc.). Use this when you want to make an entire URL text-safe without breaking its structure.
Decoding always uses decodeURIComponent, which handles all percent-encoded sequences correctly. If you need to encode binary data for non-URL contexts, use the Base64 Encoder / Decoder instead.
How to use this URL Encode calculator
- Paste your text or encoded URL into the Input field.
- Select Encode → percent-encoded or Decode ← percent-encoded from the Mode selector.
- For encoding, select the Scope: Encode component for query parameter values, or Encode full URI for a complete URL.
- The output appears instantly in the Output field.
- Copy the result using the copy icon.
Formula & Methodology
Encoding a component (encodeURIComponent): - Encodes all characters except:A–Z a–z 0–9 - _ . ! ~ * ' ( )- Each character is converted to its UTF-8 byte sequence, each byte expressed as%XX- Example:hello world→hello%20world- Example:name=value&key=other→name%3Dvalue%26key%3DotherEncoding a full URI (encodeURI): - Same as above but additionally preserves:; , / ? : @ & = + $ #- Example:https://example.com/search?q=hello world→https://example.com/search?q=hello%20worldDecoding (decodeURIComponent): - Replaces each%XXsequence with the corresponding UTF-8 byte, then decodes the byte sequence as Unicode text Valid example:q=hello world&lang=en→q=hello%20world%26lang%3Den(component-encoded) Invalid decode example:hello%2Gworld—%2Gis malformed becauseGis not a valid hexadecimal digit