Utilumo
LightDarkSystem
Guide1 min readUpdated July 1, 2026

How to URL encode a string

Short answer

Paste the text into a URL encoder and it replaces unsafe characters with %XX escapes — for example a space becomes %20. Encode individual values (not the whole URL) so delimiters like ? and & are not escaped by mistake.

What URL encoding does

A URL may only contain a limited set of characters. URL (percent) encoding replaces anything unsafe or reserved with a % followed by its hex byte value, so the data survives inside a link. See what is URL encoding for the background.

URL encode a value

  1. Paste the textEnter the value you want to place in a URL.
  2. Copy the encoded outputUnsafe characters become %XX escapes; safe ones stay as-is.
  3. Drop it into the URLUse it as a query value or a path segment.
name = John & Jane   ->   name=John%20%26%20Jane
Encoding a query value
Try it: URL Encoder/DecoderEncode and decode URL text locally — nothing is uploaded.Open tool
Encode the value, not the whole URLEncoding an entire URL escapes its own : / ? and &, which breaks it. Encode each parameter value separately so the structural delimiters stay intact.

The space rule

A space becomes %20 in a path. In query strings it is often written as + instead, a legacy of HTML form encoding. When in doubt, %20 works in both places. For the full escape table, see the URL encoding reference.

References

Questions

What is the difference between encodeURI and encodeURIComponent?

encodeURI keeps URL structure characters (like / ? &) intact and is meant for a whole URL. encodeURIComponent encodes them too and is meant for a single value you are inserting into a URL. Use encodeURIComponent for parameter values.

Why does a space become %20 or +?

Spaces are not allowed in URLs. In the path they are encoded as %20. In query strings the older form-encoding convention writes them as +, so decoders must know the context.

Does this encoder upload my text?

No. Encoding and decoding happen entirely in your browser tab. Nothing you paste is uploaded or stored.

Keep reading