SunloopMediaToolsFree Online Tools

URL Encoder / Decoder

URLs (Uniform Resource Locators) can only be sent over the Internet using the ASCII character set. Special characters like spaces, ampersands (&), question marks (?), and slashes (/) must be percent-encoded to prevent breaking query strings.

What is URL Encoder / Decoder?

A URL Encoder / Decoder converts unsafe non-ASCII or reserved characters into percent-encoded triplets (%XX) representing UTF-8 character bytes.

How to Use URL Encoder / Decoder

  1. 1Choose mode: "Encode" or "Decode".
  2. 2Select component mode: "encodeURIComponent" (for parameter values) or "encodeURI" (for full web addresses).
  3. 3Paste input string.
  4. 4View encoded/decoded output immediately.
  5. 5Copy output with one click.

How Does URL Encoder / Decoder Work?

Translates reserved characters using JavaScript `encodeURIComponent()` and `decodeURIComponent()`.

Calculation FormulaEncoded String = encodeURIComponent(rawText)

Practical Examples

Query Parameter Encoding

Input string: "search term & category=tools"

Percent-encode spaces and ampersand`search%20term%20%26%20category%3Dtools`

Frequently Asked Questions

What is the difference between encodeURI and encodeURIComponent?

`encodeURI()` preserves special URL punctuation like `?`, `:`, `/`, and `&` (used for full web links). `encodeURIComponent()` encodes ALL punctuation, ideal for query parameter values.

Why does space convert to %20 or +?

%20 is standard UTF-8 percent-encoding for spaces. The plus sign (`+`) is historical encoding used in application/x-www-form-urlencoded forms.

Can URL decoding fail?

Decoding fails if the string contains malformed percent sequences (e.g., `%` not followed by two valid hexadecimal digits).

Is URL encoding reversible?

Yes, percent encoding is 100% reversible unless data was truncated before decoding.

Is input data logged?

No data leaves your device. All encoding runs in client memory.

Related Tools