URL Encoder

The URL Encoder converts text into a URL-safe format by encoding special characters as percent-encoded sequences. URLs can only contain ASCII characters, and certain characters like spaces, ampersands, and non-ASCII characters must be encoded to be transmitted safely. This encoder follows RFC 3986, converting each unsafe character to a percent sign followed by its two-digit hexadecimal code. It is essential for building query strings, encoding form data, and constructing valid URLs with special characters.

Formula

URL encoding (percent-encoding):
- Space → %20 (or +)
- & → %26
- = → %3D
- ? → %3F
- / → %2F
- Non-ASCII → UTF-8 bytes, each %XX

Standard: RFC 3986

Example

Input: Hello World & Calczy! Output: Hello%20World%20%26%20Calczy%21 Input: search?q=python tutorial Output: search%3Fq%3Dpython%20tutorial

How to Use

  1. Enter or paste your text into the input field
  2. Click encode to convert to URL-encoded format
  3. The output shows the percent-encoded string
  4. Copy the encoded string
  5. Use it in URLs, query parameters, or API calls

Frequently Asked Questions

What is URL encoding?

URL encoding (percent-encoding) converts unsafe characters into a percent sign followed by two hexadecimal digits. This ensures URLs are transmitted correctly over the internet, as URLs can only contain ASCII characters.

What characters need to be encoded?

Reserved characters (!, *, ', (, ), ;, :, @, &, =, +, $, ,, /, ?, #, [, ]) and unsafe characters (spaces, quotes, angle brackets, non-ASCII) should be encoded when used as data in URLs.

What is the difference between encodeURI and encodeURIComponent?

encodeURI encodes a full URL but preserves reserved characters like : and /. encodeURIComponent encodes everything including reserved characters, used for query parameter values. This tool uses encodeURIComponent behavior.

Should spaces be encoded as %20 or +?

Both are valid. %20 is the standard percent-encoding. + is used in application/x-www-form-urlencoded data (form submissions). For URLs, %20 is preferred. For form data, + is common.

How are Unicode characters encoded?

Unicode characters are first converted to UTF-8 bytes, then each byte is percent-encoded. For example, the euro sign (EUR) becomes %E2%82%AC (three UTF-8 bytes).