Free tools for developers

URL Encoder & Decoder

Encode special characters in URLs or decode percent-encoded URLs back to plain text. Everything runs in your browser.


What is URL Encoding?

URL encoding, also called percent encoding, converts characters that are not allowed in a URL into a safe format. Every character that is not a letter, number, hyphen, underscore, period, or tilde gets replaced with a percent sign followed by two hexadecimal digits representing the character's ASCII code. For example a space becomes %20, an ampersand becomes %26, and a forward slash becomes %2F.

URLs can only contain a limited set of characters defined by the RFC 3986 standard. If your URL contains special characters like spaces, accented letters, Chinese characters, or symbols they must be encoded before the URL is sent over the internet. Most programming languages handle this automatically in their HTTP libraries but sometimes you need to encode values manually.

Encode URI vs Encode URI Component

There are two levels of URL encoding. Encoding a full URI preserves the structural characters that give a URL its meaning — the colon, forward slashes, question mark, hash, and ampersand. Encoding a URI component encodes everything including those structural characters. Use component encoding when encoding a value that will be placed inside a query string parameter. For example if a user searches for "C# and .NET" and you put that in a URL parameter, encode it as C%23%20and%20.NET so the ampersand and hash do not break the URL structure.

Common Characters and Their Encoded Values

Space becomes %20. Ampersand becomes %26. Plus sign becomes %2B. Equals sign becomes %3D. Question mark becomes %3F. Hash becomes %23. Forward slash becomes %2F. At sign becomes %40. Colon becomes %3A. Square brackets become %5B and %5D.

URL Encoding in Different Languages

In JavaScript use encodeURIComponent() for query string values and encodeURI() for full URLs. In Python use urllib.parse.quote() for components and urllib.parse.quote_plus() for form data. In C# use Uri.EscapeDataString() for components and Uri.EscapeUriString() for full URIs. In Java use URLEncoder.encode() with UTF-8 encoding.

How to Use This Tool

  1. Choose Encode or Decode using the tabs at the top.
  2. Choose whether to encode a full URI or just a component.
  3. Paste your text into the left input box.
  4. The result appears instantly on the right as you type.
  5. Click Copy Output to copy the result to your clipboard.
  6. Use the Flip button to swap input and output to decode what you just encoded.

Frequently Asked Questions

Why does a space become %20 and not a plus sign?

Both are valid in different contexts. %20 is the correct percent encoding for a space in a URL path or query string value. The plus sign is used for spaces specifically in HTML form data encoded as application/x-www-form-urlencoded. This tool uses %20 which is correct for general URL encoding.

When do I need to encode a URL?

Any time you are building a URL programmatically and inserting dynamic data into it. If a user types a name with spaces or special characters and you concatenate it directly into a URL it will break. Always encode user-provided data before putting it into a URL parameter.

Is URL encoding the same as Base64?

No. They are completely different encoding schemes for different purposes. URL encoding converts characters to percent-encoded format specifically for use in URLs. Base64 converts binary data to a text-safe string for transmission in systems that only support ASCII. You would never use Base64 in a URL and you would never use percent encoding to encode binary data.

Can I encode an entire URL?

You can but you usually should not encode the full URL including its structure. Encoding the full URL will encode the slashes and colons that make it a valid URL and the result will not work as a link. Use full URI encoding only when you understand exactly which characters need to stay unencoded. In most cases you only need to encode the values inside query string parameters.

Is my data safe?

Yes. Everything runs in your browser. Your URLs and text are never sent to any server.