Skip to content

URL Encoder/Decoder

Encode or decode URLs and query strings for safe web use.

Free URL Encoder/Decoder – Encode and Decode URLs Online

URL encoding, also known as percent-encoding, is a mechanism for converting characters into a format that can be safely transmitted within a URL. Since URLs can only contain certain characters from the ASCII set, any special characters, spaces, or non-ASCII characters must be encoded using a percent sign (%) followed by two hexadecimal digits.

Our URL encoder/decoder supports two standard JavaScript encoding modes. The encodeURIComponent function encodes all special characters, making it ideal for encoding individual query parameters or form values. The encodeURI function preserves the URL structure characters like colons, slashes, question marks, and hash symbols, making it suitable for encoding complete URLs.

Understanding the difference between these two modes is crucial for web developers. Using encodeURIComponent on a full URL would break it by encoding the protocol separators and path delimiters. Conversely, using encodeURI on a query parameter value would fail to encode characters like ampersands and equals signs that have special meaning in query strings.

Common use cases for URL encoding include building API request URLs with dynamic parameters, encoding form data for submission, handling internationalized URLs with non-Latin characters, and debugging encoded URLs by decoding them back to readable text. Our tool provides instant bidirectional encoding and decoding with a clean, simple interface.

FAQ

Share
SponsoredAd

Work smarter with PDF tools by Adobe

Convert, edit, sign, and share PDFs from anywhere. The industry standard for document management.

FAQ

What is URL encoding?+
URL encoding (percent-encoding) converts characters into a format safe for URLs. Special characters, spaces, and non-ASCII characters are replaced with a percent sign followed by two hex digits. For example, a space becomes %20, and an ampersand becomes %26.
What is the difference between encodeURIComponent and encodeURI?+
encodeURIComponent encodes ALL special characters including :, /, ?, #, &, and =. It is used for encoding individual values like query parameters. encodeURI preserves URL structure characters and only encodes characters that are not valid anywhere in a URL. Use encodeURI for complete URLs and encodeURIComponent for parameter values.
When should I URL-encode text?+
You should URL-encode text when including it in a URL as a query parameter, path segment, or fragment. This is especially important for text containing spaces, special characters (& = ? #), or non-Latin characters. Most web frameworks handle encoding automatically, but manual encoding is needed when building URLs programmatically.
Why does my URL have %20 instead of spaces?+
%20 is the URL-encoded representation of a space character. URLs cannot contain literal spaces, so they must be encoded. In HTML forms using GET method, spaces may also appear as + signs. Both %20 and + represent spaces, but %20 is the standard percent-encoding.
Can URL encoding handle Unicode and emoji?+
Yes, URL encoding handles Unicode characters by first converting them to UTF-8 bytes, then percent-encoding each byte. For example, the euro sign becomes %E2%82%AC (three UTF-8 bytes). Emoji and other multi-byte characters work the same way, resulting in longer encoded sequences.

Most Popular Tools