URL Encoder & Decoder

Encode special characters in URLs using percent-encoding, or decode percent-encoded strings back to readable text. Uses the RFC 3986 standard via JavaScript's encodeURIComponent.

Output

About This Tool

URL encoding, also called percent-encoding, is a mechanism for encoding information in a Uniform Resource Identifier (URI). Certain characters have special meaning in URLs — such as &, =, ?, and spaces — and must be encoded when used as literal data rather than as URL syntax delimiters.

This tool uses JavaScript's built-in encodeURIComponent() and decodeURIComponent() functions, which adhere to RFC 3986. Every character that is not an unreserved character (letters, digits, -, _, ., ~) is percent-encoded.

URL encoding is essential when building query parameters, constructing API requests, processing form data, or working with URLs that contain spaces or non-ASCII characters such as accented letters or Asian scripts. Without proper encoding, URLs break and servers may reject the request or misinterpret the data.

All processing is done in your browser with no server communication, making this tool safe for sensitive URLs containing tokens, passwords, or private parameters.

How to Use

  1. Paste or type the URL or text string you want to process into the input box.
  2. Click Encode URL to percent-encode special characters (e.g., spaces become %20).
  3. Click Decode URL to convert percent-encoded sequences back to readable characters.
  4. Copy the result using the Copy button.
  5. If the input contains invalid percent-encoded sequences during decoding, a helpful error message is shown.

Common Use Cases

  • Encoding query string parameters before appending them to a URL
  • Decoding URLs received from logs, APIs, or browser address bars
  • Processing form data with special characters
  • Working with internationalized URLs containing non-ASCII characters
  • Debugging redirect chains and URL parsing issues

Frequently Asked Questions

What is URL encoding?

URL encoding (also called percent-encoding) converts characters that are not allowed in a URL into a format that can be safely transmitted. Each unsafe character is replaced by a percent sign followed by two hexadecimal digits, for example a space becomes %20.

What characters need to be URL encoded?

Any character outside the unreserved set must be encoded. Unreserved characters are letters (A–Z, a–z), digits (0–9), and the symbols hyphen (-), underscore (_), period (.), and tilde (~). All other characters — including spaces, &, =, ?, #, and non-ASCII characters — must be percent-encoded.

What is the difference between encodeURI and encodeURIComponent?

encodeURI encodes a full URL and leaves structural characters like /, ?, and # intact. encodeURIComponent encodes a single value and encodes everything including those structural characters. This tool uses encodeURIComponent, which is correct for encoding individual query string values.

Why does a space become %20?

%20 is the percent-encoded representation of the ASCII space character (decimal 32, hexadecimal 20). Some systems also use a plus sign (+) to represent spaces in query strings, but %20 is the standard defined by RFC 3986.