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.
Reviewed by the thecalcu.com team · Last updated June 21, 2026
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.
Why Use a URL Encoder / Decoder?
URLs in browser address bars often appear decoded for readability, but the actual network request uses the encoded form. When building APIs, constructing redirect URLs, or debugging network traffic, you need to switch between these representations quickly.
Common situations: a search query with special characters breaks a URL; a file path with spaces needs to be embedded in a redirect parameter; a webhook URL with & in query values needs encoding before being stored in a config file.
Who Should Use This Tool?
Back-end and API developers, encode query parameters when constructing URLs programmatically, decode incoming request parameters for inspection.
Front-end developers, verify query string values are correctly encoded before they are sent, and decode URL parameters when debugging redirect chains.
DevOps engineers, encode values in webhook URLs and callback endpoints that are stored in configuration files or environment variables.
QA engineers, test how applications handle special characters in URL parameters by generating encoded variants.
What Insights Does This Formatter Give You?
Encoding mode produces the percent-encoded form of the input, using either encodeURIComponent (for data values) or encodeURI (for full URIs). Decoding mode converts any percent-encoded input back to readable text.
If decoding fails, a specific error identifies malformed percent-sequences in the input.
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
Frequently Asked Questions