URL Encoder / Decoder

Percent-encode text for URLs or decode encoded URL strings.

What Does the URL Encoder / Decoder Do?

This tool percent-encodes text for safe use in URLs and decodes percent-encoded strings back to readable text. It offers the two standard modes developers actually need: encodeURIComponent, which encodes every reserved character and is right for query-string values, and encodeURI, which preserves URL structure characters (:/?&=#) and is right for encoding a complete URL.

Spaces become %20, an ampersand becomes %26, and non-ASCII characters are encoded as their UTF-8 byte sequences โ€” รฉ becomes %C3%A9. When decoding, + signs are also converted back to spaces to handle the common form-encoding variant.

How to Use the Tool

  1. Choose Encode or Decode.
  2. Pick the mode: encodeURIComponent for values, encodeURI for whole URLs.
  3. Type or paste your text โ€” conversion happens live.
  4. Copy the result. Malformed percent-sequences produce a clear error when decoding.

When Do You Need URL Encoding?

  • Query parameters โ€” a search for "coffee & cream" must be sent as q=coffee%20%26%20cream, or the ampersand splits the query.
  • Redirect and callback URLs โ€” a URL passed inside another URL must be fully component-encoded or its own parameters leak into the outer URL.
  • Debugging โ€” decode a long tracking link or OAuth redirect to see what is actually inside it.
  • International text โ€” filenames and paths containing accents or non-Latin scripts need percent-encoding to travel reliably.

Frequently Asked Questions

When should I use encodeURIComponent vs encodeURI?

Use encodeURIComponent for a single value going into a query string โ€” it encodes &, =, ? and / so they cannot break the URL. Use encodeURI only when encoding a complete URL whose structure must stay intact.

Why did + turn into a space when decoding?

In the application/x-www-form-urlencoded format used by HTML forms, spaces are encoded as +. The decoder converts + to a space to handle that convention; %20 always decodes to a space too.

What does %C3%A9 mean?

It is the letter รฉ: URLs carry UTF-8 bytes, and รฉ is the two-byte sequence C3 A9. Each byte is written as % followed by two hex digits.

Why does decoding fail with "malformed" errors?

The input contains a % not followed by two valid hex digits โ€” usually a truncated string or text that was never actually URL-encoded.