URL / URI Encoding

URL Encoder / Decoder

Encode text into percent-encoded URL format, or decode an already-encoded URL back to readable text. Supports both full-URI and component encoding modes.

Input Text or URL

Result


Enter text or a URL to encode/decode
⚠️

Disclaimer: This tool runs entirely in your browser — no data is sent to any server. Always verify encoded URLs work as expected in your target application before deploying to production.

About the URL Encoder / Decoder

URL encoding (also called percent-encoding) converts characters that aren’t allowed in a URL — like spaces, ampersands, and special symbols — into a %XX format safe for transmission over the web.

Component vs. Full URI Encoding

Component encoding (encodeURIComponent) escapes nearly all special characters, making it ideal for encoding individual query parameter values. Full URI encoding (encodeURI) preserves structural characters like : / ? # & = so it’s safe to use on an entire URL without breaking its structure.

Common Use Cases

URL encoding is essential when passing user-generated text (like search queries or form data) as part of a URL, ensuring spaces, quotes, and other special characters don’t break the link or introduce security issues.

Worked Example

Take the text name=Ravi & Sons/café?. In Component mode the result is name%3DRavi%20%26%20Sons%2Fcaf%C3%A9%3F, because every reserved character is escaped. In Full URI mode the same text gives name=Ravi%20&%20Sons/caf%C3%A9?, where =, &, / and ? stay as they were. Only the space and the accented letter changed.

A whole address behaves differently. https://example.com/search?q=chai latte&lang=en in Full URI mode becomes https://example.com/search?q=chai%20latte&lang=en (47 characters grow to 49), which is still a working link. In Component mode it turns into https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dchai%20latte%26lang%3Den, which no longer works as an address.

Common Mistakes

Where You Would Use This

Tips for Reliable Results

Encode each piece separately and then assemble the address. For example, encode the value of each parameter in Component mode, then join the parts with the ampersands and equals signs yourself. After encoding, compare the length figures: if the encoded text is the same length as the original, nothing needed escaping. When decoding a long link, do it in stages, because a link can be encoded more than once by different services. If the decoder reports a malformed sequence, look for a percent sign that is not followed by two hexadecimal characters, which usually means the text was truncated or only partly encoded. Non-English letters and symbols are encoded as several percent groups, so one character such as the rupee sign turns into nine characters (%E2%82%B9), and the length figures will grow by more than you might guess. Keep that in mind when a system limits the length of a link or a parameter.

Frequently Asked Questions

Use component encoding (encodeURIComponent) when encoding a single value that will be inserted into a URL, like a query parameter. Use full URI encoding (encodeURI) when you have a complete URL and want to preserve its structure (slashes, question marks, etc.) while still encoding unsafe characters.
Spaces aren't valid in URLs, so they must be percent-encoded. %20 is the standard percent-encoding for a space character (some older systems use + instead, but %20 is the RFC 3986 standard).
This tool runs entirely in your browser using JavaScript's built-in encodeURIComponent/decodeURIComponent functions — no data is transmitted to any server, so it's safe to use with any text.
Decoding fails if the input contains malformed percent-encoding (e.g. a stray % not followed by two valid hex digits). Double-check that your encoded string wasn't truncated or manually edited incorrectly.