Skip to content
SocialTools

URL Encoder Decoder

Percent-encode text for safe use in a link parameter, or turn an encoded string back into readable text.

What it does

Choose Encode or Decode, paste your text, and the converted version appears below. Encoding turns spaces, ampersands, slashes, emoji, and other reserved characters into percent codes such as %20 and %26, so the text can sit inside a query parameter without splitting the link apart.

Marketers use it when a campaign name or prefilled message contains spaces or symbols. Decoding is the reverse: paste a messy tracking URL or a value copied from analytics and read what it actually says.

How to use it

  1. 1

    Pick Encode or Decode from the dropdown at the top.

  2. 2

    Paste the text or encoded string into the Input box.

  3. 3

    Read the converted result in the Output box.

  4. 4

    Click the copy button next to Output and paste the value into your link.

What you get

The encoded or decoded string in a read-only Output box with a copy button. If a decode input contains a malformed percent sequence, the output shows "Invalid URI component" instead.

When to use it

Encode a UTM campaign value
Turn a campaign name like "spring sale & bundles" into a value that will not cut the query string at the ampersand.
Build a prefilled message link
Encode the text for a share or messaging link so spaces, line breaks, and emoji survive the click.
Read an encoded tracking URL
Decode a long redirect or affiliate link to see the destination and parameters hidden behind the percent codes.
Debug a broken query value
Check whether a parameter was double-encoded (for example %2520 instead of %20) by decoding it once and looking at the result.

Example

Input

Mode: Encode
Text: summer sale & 20% off

Output

summer%20sale%20%26%2020%25%20off

The space becomes %20, the ampersand becomes %26, and the percent sign becomes %25, so the value can safely follow utm_campaign= in a link.

Tips

  • Encode only the parameter value, not the whole URL. Encoding a full address also escapes the :// and / characters and the link will stop working.
  • If a decoded value still contains codes like %20, it was encoded twice. Decode it again to reach the original text.
  • A plus sign is not turned into a space when decoding. If a form-style string uses + for spaces, replace them before decoding.
  • Letters, digits, and the characters - _ . ! ~ * ' ( ) are left as they are when encoding, which is normal.

Questions

Does this use encodeURI or encodeURIComponent?

encodeURIComponent. It escapes reserved characters such as &, =, ?, /, and #, which is what you want for a single query parameter value.

Why does decoding show "Invalid URI component"?

The input contains a percent sign that is not followed by a valid two-digit hex code, such as "50% off" or a truncated sequence. Fix or encode that part first.

Should I paste my entire link into the encoder?

No. Encode only the value that goes after the equals sign. Encoding the whole link escapes the slashes and colon in https:// and breaks it.

How are emoji and accented letters encoded?

They are converted to their UTF-8 bytes, each written as a percent code, so one emoji can become a sequence like %F0%9F%94%A5.