Skip to content
Pro
TREN

URL Encode and Decode

Encode or decode a URL and its query values. Paste a full address and see its parts in a table.

How it works

  1. Paste your text or your address into the input field.
  2. Set the direction (Encode / Decode) and the scope (Part / Full URL).
  3. Copy the result and read the URL parts below.

Why this tool

  • Two scopes: encodeURIComponent and encodeURI.
  • Splits a full address into protocol, host, path and fragment.
  • Lists the query parameters in a key and value table.
  • Gives a clear message when an escape sequence is broken.
  • Everything runs in your browser. The address is not uploaded.

URL encoding makes characters with a special meaning safe inside an address. The separators are known: a slash splits the path, a question mark starts the query, an ampersand divides parameters and a hash opens the fragment. If a value contains one of these characters, you must encode it. If you do not, the address is read the wrong way.

Two functions exist and people mix them up. encodeURIComponent encodes a single value and escapes the separators too. Use it when you build a query value, a path part or a form field. encodeURI repairs a complete address. It leaves the separators alone and escapes only invalid characters such as a space. If you run a full address through encodeURIComponent, you get unusable text.

Accented letters first become UTF-8 bytes. The letter ş is two bytes and becomes %C5%9F. Long escape sequences are normal.

Double encoding is a common fault. If a value is encoded twice, a space becomes %2520 instead of %20. Press Decode twice to repair it.

The table below shows the parts of a full address: protocol, host name, port, path, query and fragment. Query parameters appear as key and value pairs. That makes a long tracking link easy to read.

Everything runs in your browser. The address does not go to a server.

Frequently asked questions

What is the difference between the two scopes?

Part (encodeURIComponent) also encodes the separators. Use it for a single value. Full URL (encodeURI) leaves the separators alone. Use it to repair a complete address.

Why is a space sometimes %20 and sometimes a plus?

In a URL path a space becomes %20. In form data it becomes a plus. This tool writes %20. Your browser writes a plus when it submits a form.

How are accented letters encoded?

They first become UTF-8 bytes and then each byte becomes a percent pair. The letter ş becomes %C5%9F. A two part escape sequence is normal.

Why do I get a decode error?

The text holds a lone percent sign or a broken escape sequence. For example %zz is not valid. Write a percent sign as %25.

How do I repair a double encoded address?

Press Decode twice. A sequence such as %2520 is the sign of double encoding.

Is my address stored?

No. Encoding and parsing run in your browser. It is safe to paste an address that holds a token.