URL Encoder / Decoder

Percent-encode text so it is safe in query strings, paths and fragments, or decode an encoded URL back to readable text.

Free, no sign-upRuns in your browserDeveloper and encoders

Input

The output updates as you type.
Use value mode for query parameters. Full URL mode keeps / ? & # intact.

Output


    

How to use the URL encoder and decoder

Paste your text or URL and pick a mode. Encode a value (encodeURIComponent) is the one you want most of the time, for query parameter values. Encode a full URL (encodeURI) keeps the structure characters / ? & # untouched. Decode reverses either one. The output updates as you type.

Why encoding matters

URLs only allow ASCII letters, digits and a small set of reserved characters. Spaces, emoji, accented letters, ampersands inside values and quote marks all need to be percent-encoded. Without encoding, a URL breaks at the first ampersand inside a value, gets cut off at the first space, or returns a 404 on a UTF-8 character. Percent-encoding is the standard fix.

Common use cases

  • Building UTM-tagged campaign URLs that contain spaces or accented characters
  • Encoding form data for GET requests
  • Debugging tracking links where parameters look corrupted
  • Building API endpoints with user-generated content in the path
  • Encoding non-Latin characters (Japanese, Arabic, Cyrillic) for URLs
  • Decoding URLs from logs so they are readable again

encodeURI vs encodeURIComponent

encodeURI is for whole URLs. It leaves structure characters like / ? & # alone because they carry meaning in a URL. encodeURIComponent is for single values and encodes everything that needs it, including / and &. Use encodeURIComponent for query parameter values, and encodeURI for complete URLs you assembled from trusted parts.

Frequently asked questions

Why does a space sometimes become + and sometimes %20?

Both can stand for a space, but in different places. In query strings from HTML forms, + is common. In paths, only %20 works. JavaScript encoders always use %20 to avoid ambiguity.

Do I need to encode # and &?

Inside a parameter value, yes, or & will be read as the start of the next parameter. In a fragment after #, an ampersand is fine. In a path, encode # but leave slashes alone.

Why does my emoji get mangled in URLs?

Emoji are multi-byte UTF-8 characters, and many systems do not percent-encode them automatically. Run user-generated content through encodeURIComponent before adding it to a URL.

Will encoding break my tracking pixel?

Only if it is encoded twice. Watch for %2520 where you expected %20. Decode once, then encode once.