URL Encoder and Decoder
Loading developer controls…
URL Encoder and Decoder At a Glance
URLs contain structural characters such as the colon, slash, question mark, ampersand, and equals sign. Inside a complete address those characters may separate its parts, but inside a single parameter value they can be ordinary data. Percent-encoding expresses certain bytes as a percent sign followed by two hexadecimal digits so the value can travel without confusing the surrounding structure.
This tool offers two modes because encoding a component is not the same as preparing an entire address. Component mode encodes text such as a search term that will become one query value. Complete URL mode uses the built-in URL parser for HTTP or HTTPS addresses and maintains recognizable URL structure. During decoding, the selected mode determines which encoded characters can be restored without collapsing separators into plain text.
How to Encode a URL Query Value
Select Encode and choose Query value or text component. Paste the text that should be treated as one value, such as `red shoes & socks`. The resulting encoded value can be placed after a parameter name, preventing the ampersand from being misread as the start of a new parameter. Use the output only where a single component belongs; it is not intended to replace the full structure of a URL.
If you already have a complete URL, select Complete URL (keep structure) instead. Enter a fully qualified address beginning with HTTP or HTTPS, then process it. The built-in URL parser normalizes characters such as spaces where needed and preserves the address’s main separators. It may also normalize host casing, default ports, or other URL details according to platform behavior. Review the result before using it in a published link.
How to Decode Percent-Encoded Text
A decoded component is easier to inspect when it contains a human-readable phrase or data value. Choose Decode, select Query value or text component, and paste the encoded sequence. A value like `one%20two` becomes two words separated by a space. The decoder checks that each percent escape is valid; a lone percent sign or incomplete hexadecimal pair produces an error rather than an invented interpretation.
Whole-URL decoding behaves differently because reserved characters may still act as separators. In Complete URL mode, decoding uses rules intended to avoid turning every encoded delimiter into a structural character. Even so, a decoded URL can be ambiguous for reuse. If you are reconstructing a live hyperlink, prefer parsing its components and encoding individual values again rather than copying a manually decoded string into an HTTP request.
Why Spaces, Ampersands, and Slashes Matter
A space is not usually written as a literal space in a web address; it is commonly represented as `%20` or by a plus sign in form-style query encoding. An ampersand separates query parameters, while an equals sign separates parameter names from values. If those characters are meant to be part of a value instead, encode the value before concatenating it with the rest of the query string.
Slashes illustrate the same distinction. A slash in a path separates segments, while a slash inside an arbitrary value may need encoding. Encoding an entire URL as a single component would escape its path separators and scheme punctuation, leaving text that no longer behaves as a link. A careful choice of input type is therefore more important than simply finding a button called Encode.
Encoding Unicode Characters in URLs
Modern URLs routinely contain names and search terms written in many languages. Percent-encoding operates on the UTF-8 bytes associated with those characters, so one visible character may become several `%HH` sequences. This is expected and does not mean the information has been lost. A correct decoder can reconstruct the original character sequence when it has all the necessary bytes.
When a URL looks longer after encoding, compare the decoded result rather than trying to count characters in its percent-encoded spelling. Applications may display an internationalized domain in a separate ASCII-compatible form, while the path and query follow their own rules. Avoid manually changing encoded bytes in a production URL: even a small alteration can change the resource or break a signature.
Avoiding Double Encoding
Double encoding happens when a value is encoded, then an additional step encodes the percent signs again. For example, `%20` can become `%2520`. After one decode, the text still contains `%20` rather than the intended space. This is common when a framework, URL builder, or API client already handles encoding automatically and the developer adds another manual transformation on top.
Before fixing a seemingly garbled query, trace where each encoding step occurs. A form submission, browser API, and server framework may each apply or interpret URL rules. Use component mode for raw values that have not been encoded yet, and avoid passing pre-encoded values to a library that expects unescaped input. If you need tracking links, the encoded output should be used only once per transformation; do not chain its own output through the same operation without a reason.
URL Encoding and Web Security
Encoding is not authorization, sanitization, or encryption. An encoded script fragment is still potentially dangerous if an application later decodes it and inserts it into an unsafe context. A percent-encoded path traversal sequence can also become risky if a server treats decoded segments as filesystem paths without proper validation. Secure handling depends on context-aware output encoding, validated destinations, and application access controls.
The tool accepts complete URLs only when their scheme is HTTP or HTTPS. That check helps avoid accidentally normalizing other schemes in this mode, but it does not establish that the destination is legitimate or harmless. Inspect domains before clicking a link, especially when a display string and the actual destination differ. Percent encoding makes strings transportable; it cannot tell you whether a website deserves trust.
Working With Parameters and Tracking Links
Marketing links often contain several query parameters, each with its own name and value. If a campaign name includes spaces, an ampersand, or non-English letters, it should be encoded as a component before joining it to the address. Existing query parameters need to remain distinct; appending an already encoded whole query string as a single value will change the information your analytics system receives.
The safest programmatic approach is often to use `URL` and `URLSearchParams`, which handle escaping while keeping parameters organized. For manual inspection, decoding an individual value can make the intended campaign name visible. Remember that advertising platforms may have their own conventions for naming parameters and handling click identifiers. Test the final link in a controlled setting and confirm the receiving service sees the expected values.
Checking a URL Before Publishing
When preparing a redirect, email link, or published call to action, verify the scheme, host, path, query parameters, and fragment separately. Ensure the destination is correct and that a converted value has not been inserted into the wrong location. A pasted address can contain accidental line breaks or spaces that the parser normalizes, which may hide an upstream data-entry mistake. Review the canonical version before sharing it publicly.
Keep a copy of the original URL if it is part of a debugging report. Comparing the original and normalized forms can show which characters changed. If a long address contains many parameters, test one value at a time rather than applying percent-decoding to the entire string and making its separators ambiguous. This discipline is particularly useful for API integrations, site migrations, and analytics troubleshooting.
Fragments, Query Strings, and Redirect Targets
Everything after a hash mark in a URL is a fragment used by client-side navigation or page behavior. It is not sent in the same way as the path and query in a typical HTTP request. Encoding a hash inside a query value prevents it from being mistaken for the start of a fragment, while decoding a whole address without considering that distinction can create unexpected navigation. Whenever you transform a redirect target, inspect its fragment separately from the parameters the server receives.
Links inside email campaigns and support messages deserve a final click test. A value may look readable when decoded yet be malformed after concatenation with an existing query, especially when the destination already includes a question mark or parameters. Use a URL construction library for production code, and compare the final parsed host and path against what you intended. Percent encoding preserves a representation; it does not verify the destination, detect tracking mistakes, or guarantee the receiver interprets the query as expected.
Frequently Asked Questions About URL Encoder and Decoder
What is the difference between encodeURIComponent and a complete URL?
A component encoder treats the whole input as one piece of data and escapes reserved separators. A complete-URL operation preserves the structure of an address, including its scheme, hostname and path delimiters.
Why does a space appear as %20 instead of a plus sign?
Percent-encoding and form-style query encoding have related but distinct conventions. A component encoder commonly uses %20 for a space, whereas HTML form encoding may represent one as a plus sign.
Can I decode an entire tracking link at once?
You can inspect a whole URL, but decoding reserved sequences can introduce ambiguity about which symbols are structural. For reliable reuse, parse the address and decode individual parameter values instead.
Why do I see %2520 in a link?
That often means the percent sign in %20 was encoded again. Check whether a library or framework already encodes parameters before manually processing the value.
Does encoding make a dangerous URL safe?
No. Percent encoding changes its representation, not its trustworthiness. Validation, allowlisting, access controls and safe application handling are separate responsibilities.
Can the tool handle accented letters and emoji?
Yes. Component encoding produces percent sequences from their UTF-8 bytes. Decoding reconstructs the original Unicode text when the encoded bytes are complete and valid.