URL Encode Online – Free Percent-Encoding Tool

Convert special characters to URL-safe percent-encoded format in seconds. Base64 Shuttle encodes everything locally in your browser for fast, private results.

What Is URL Encoding?

URL encoding, formally known as percent-encoding, is a mechanism for encoding information in a Uniform Resource Identifier (URI). It replaces characters that are not allowed in a URL with a percent sign (%) followed by two hexadecimal digits representing the byte value. For example, a space character becomes %20, an ampersand (&) becomes %26, and a forward slash (/) becomes %2F when it needs to be escaped.

The URL specification (RFC 3986) defines which characters are safe to use directly in a URL and which must be encoded. Unreserved characters like letters, digits, hyphens, periods, underscores, and tildes do not need encoding. All other characters, including spaces, punctuation, and non-ASCII letters, must be percent-encoded to create a valid URL.

URL encoding is essential when constructing URLs dynamically, especially when user input is included in query parameters. Without proper encoding, special characters in the input could break the URL structure or cause unexpected behavior on the server.

How to URL Encode a String

  1. Open the encoder: Go to the URL Encode page on Base64 Shuttle. No signup or download is needed.
  2. Enter your text: Type or paste the string you want to encode. This could be a search query, a form field value, or any text with special characters.
  3. Click Encode: The tool instantly converts all unsafe characters to their percent-encoded equivalents. The result is a valid URL-safe string.
  4. Copy the output: Click the Copy button to save the encoded string to your clipboard. Paste it directly into your URL query parameters, API requests, or form submissions.

Key Features

  • Standards-compliant: Follows RFC 3986 percent-encoding rules for full compatibility with browsers, servers, and APIs.
  • Client-side encoding: All processing happens in your browser. Your data is never sent to a server.
  • Unicode support: Correctly encodes multi-byte UTF-8 characters, including Chinese, Japanese, Arabic, and emoji characters.
  • Batch encoding: Encode multiple strings or an entire URL at once without restrictions.
  • Instant results: The encoder produces results in milliseconds, regardless of input length.
  • Free and unlimited: Use the tool as many times as you want with no usage caps or hidden costs.
  • Mobile-friendly: The responsive design works on any device, from desktop monitors to phone screens.

Common Use Cases for URL Encoding

Query parameter construction:When building URLs with query strings, the parameter values must be encoded. For example, a search for "café & restaurant" must be encoded as "caf%C3%A9%20%26%20restaurant" to be included safely in a URL.

Form submissions:HTML forms with the "application/x-www-form-urlencoded" content type automatically encode field values. Understanding URL encoding helps you debug form submissions and build custom form handlers.

API development: REST APIs often accept parameters in the URL. Proper encoding ensures that special characters in request parameters do not break the API call or cause the server to misinterpret the data.

Web scraping: When constructing URLs for web scraping, you need to encode search terms and filter values to match the format expected by the target website.

Email links:The "mailto:" URL scheme uses URL encoding for the subject and body parameters. Encoding ensures that line breaks and special characters in the email content are preserved correctly.

URL Encoding vs. Base64 Encoding

URL encoding and Base64 encoding serve different purposes. URL encoding is designed specifically for URLs—it replaces only the characters that are unsafe in URL context while keeping the output human-readable where possible. Base64 encoding converts all data into a fixed set of 64 characters and is used for embedding binary data in text formats like JSON or HTML.

Use URL encoding when you need to include text in a URL. Use Base64 when you need to embed binary data in a text-based format. They are not interchangeable, and using the wrong one can lead to broken URLs or corrupted data.

Frequently Asked Questions

What is URL encoding?

URL encoding, also called percent-encoding, replaces unsafe or reserved characters in a URL with a percent sign followed by two hexadecimal digits. For example, a space becomes %20 and an ampersand becomes %26.

Why do I need to URL encode my strings?

URLs can only contain a limited set of ASCII characters. Characters like spaces, question marks, and Unicode letters are not allowed in certain parts of a URL. Encoding these characters ensures the URL is valid and can be processed correctly by browsers and servers.

What is the difference between URL encoding and URL escaping?

They are the same thing. URL encoding and URL escaping both refer to the process of replacing unsafe characters with percent-encoded sequences. The terms are used interchangeably in web development.

Should I encode the entire URL or just the query parameters?

You should typically encode only the values of query parameters and path segments, not the entire URL. Structural characters like "://", "?", "=", and "&" should remain unencoded because they define the URL structure.

Can I encode Unicode characters for URLs?

Yes, Unicode characters are first encoded to UTF-8 bytes, and then each byte is percent-encoded. For example, the character "é" (UTF-8 bytes 0xC3 0xA9) becomes %C3%A9 in a URL.

Is URL encoding the same as URI encoding?

Yes, URL encoding and URI encoding refer to the same percent-encoding mechanism defined in RFC 3986. The terms are often used interchangeably in practice.