← All Tools
🔗

URL Encoder / Decoder

URL Encoding / Decoding

URL Encoder/Decoder - Free Online URL Percent Encoding Tool

This free online URL encoder and decoder converts special characters in URLs to their percent-encoded equivalents, or decodes percent-encoded strings back to readable text. All encoding and decoding happens instantly in your browser, so your data remains completely private. Whether you are building API requests, debugging query strings, or handling internationalized URLs, this tool gives you accurate results in one click.

How to Use

  1. Type or paste the URL, query parameter, or any text containing special characters into the input field above.
  2. Click Encode to convert special characters to their percent-encoded format (e.g., spaces become %20, ampersands become %26). Alternatively, click Decode to convert a percent-encoded string back to its original readable form.
  3. The result will appear in the output field. Click Copy Result to copy the result to your clipboard.

What is URL Encoding?

URL encoding, also known as percent encoding, is a mechanism defined in RFC 3986 for representing special characters in URLs. Since URLs can only contain a limited set of characters from the ASCII character set, any characters outside this set (such as spaces, non-Latin characters, and certain symbols) must be encoded. The encoding process replaces unsafe characters with a percent sign (%) followed by two hexadecimal digits representing the character's byte value in UTF-8.

  • Reserved Characters - Characters like &, =, ?, /, #, and + have special meaning in URLs. When these characters are part of actual data (such as a search query), they must be percent-encoded to avoid being misinterpreted.
  • Spaces - Spaces in URLs are encoded as %20 (or sometimes as + in form data). This is one of the most common encoding scenarios.
  • Non-ASCII Characters - International characters (such as Chinese, Japanese, Korean, Arabic, accented letters, and emoji) are first encoded to their UTF-8 byte representation, and then each byte is percent-encoded.
  • Safe Characters - Unreserved characters including letters (A-Z, a-z), digits (0-9), hyphens (-), underscores (_), periods (.), and tildes (~) do not need to be encoded.

Common Use Cases

  • API Development - Encode query parameters and form data before sending HTTP requests to ensure special characters are transmitted correctly.
  • Debugging URLs - Decode complex URLs to understand their query parameters and path segments in readable form.
  • Link Sharing - Encode URLs that contain spaces or special characters so they work correctly when shared in emails, chat messages, or documents.
  • SEO and Analytics - Decode tracking URLs and UTM parameters to verify that campaign data is correct and readable.

Frequently Asked Questions

Q. What is the difference between encodeURI and encodeURIComponent?

A. In JavaScript, encodeURI is designed to encode a complete URI while preserving characters that have special meaning in URLs (such as :, /, ?, and #). In contrast, encodeURIComponent encodes every special character, making it suitable for encoding individual query parameter values. This tool uses encodeURIComponent-style encoding, which is the safest approach for encoding arbitrary text that will be used as part of a URL.

Q. Why do I see %20 instead of a plus sign (+) for spaces?

A. Both %20 and + can represent a space in URLs, but they are used in different contexts. The %20 encoding is the standard percent encoding defined by RFC 3986 and works everywhere in a URL. The + notation for spaces is specific to the application/x-www-form-urlencoded format used in HTML form submissions. This tool uses %20 as it is the universally accepted representation.

Q. Can I encode entire URLs or just query parameters?

A. You can encode any text you enter. However, it is generally best practice to encode only the values of query parameters rather than the entire URL, because encoding the entire URL will also encode structural characters like :// and / that need to remain unencoded for the URL to function correctly. If you need to decode an already-encoded full URL, the Decode function will work perfectly for that purpose.