Skip to content

URL Encoder / Decoder

Encode and decode URLs online. Free URL encoding tool with encodeURIComponent support.

What is URL Encoding?

URL encoding, also known as percent encoding, is the process of converting characters into a format that can be safely transmitted within a URL. According to RFC 3986, URLs can only contain a limited set of ASCII characters. Any character outside this set, including spaces, ampersands, equals signs, and non-ASCII characters, must be replaced with a percent sign followed by two hexadecimal digits representing the character's byte value. For example, a space becomes %20 and an ampersand becomes %26. This encoding ensures that URLs are interpreted correctly by browsers, servers, and APIs regardless of the characters they contain.

How to Use This Tool

To encode text, paste your string or URL into the input area and click "Encode." The tool converts all reserved and unsafe characters into their percent-encoded equivalents using JavaScript's native encodeURIComponent function. To decode, paste a percent-encoded string and click "Decode" to restore the original characters. The output includes a copy button for quick transfer. Use the "Clear" button to reset the input and output fields.

Common Use Cases

  • Encoding query string parameters that contain special characters like spaces, ampersands, or equals signs
  • Preparing user-generated content for safe inclusion in URLs, redirect paths, or deep links
  • Decoding percent-encoded URLs from access logs, analytics platforms, or error reports for readability
  • Building OAuth callback URLs, webhook endpoints, or API request URLs with dynamic parameters

Why Use a Client-Side Tool?

URLs frequently contain sensitive information such as API keys, session tokens, user identifiers, and authentication parameters. Encoding or decoding these on a remote server exposes your data to potential interception or logging. Our tool runs entirely in your browser using native JavaScript functions. No data is sent over the network, no information is stored, and no third-party code processes your input. This makes it safe to work with production URLs, OAuth tokens, and any URL that contains private parameters.

Frequently Asked Questions

What is the difference between encodeURI and encodeURIComponent?

encodeURI encodes a complete URL but preserves characters that have special meaning in URLs like colons, slashes, and question marks. encodeURIComponent encodes everything except letters, digits, and a few safe characters, making it the right choice for encoding individual parameter values. This tool uses encodeURIComponent for thorough encoding.

Why do spaces sometimes appear as + instead of %20?

The plus sign for spaces comes from the application/x-www-form-urlencoded format used in HTML form submissions. Standard percent encoding (RFC 3986) uses %20 for spaces. This tool follows the RFC 3986 standard and encodes spaces as %20, which is universally accepted by all web servers and APIs.

Does URL encoding support non-English characters?

Yes. Non-ASCII characters like Chinese, Japanese, Arabic, and accented Latin characters are first encoded to their UTF-8 byte sequences, and each byte is then percent-encoded. This tool fully supports all Unicode characters through JavaScript's native encoding functions.