How to Encode and Decode URLs

URLs can only safely contain a limited set of characters. A space, an ampersand, or a letter with an accent can all break a link or get misread. Encoding fixes that by replacing them with a percent sign and a code.

What URL encoding does

Encoding converts a character into % followed by its hex value, so a space becomes %20 and an ampersand becomes %26. The text still means the same thing, it's just written in a form that any URL can carry safely.

When you actually need it

How to encode or decode text

  1. Paste the text into the URL encoder and decoder.
  2. Click Encode to make it URL-safe, or Decode to reverse an already-encoded value.
  3. Copy the result.

There's also an option to encode a full URL instead of a single value, which keeps characters like :, /, and ? untouched since they define the URL's structure.

Why decoding sometimes fails

Decoding breaks when the text contains a % that isn't followed by a valid two-digit code, which usually means the text wasn't actually URL-encoded to begin with, or got cut off partway through.

Related articles

← All guides