Developer & Data

Encode URL Components Without Changing Their Meaning

Updated

A URL containing a space, an ampersand or a plus sign can be misread when it is assembled by hand. Encoding a component tells the receiving system which characters belong to the value and which separate parts of the address.

URL Component Encoder & Decoder offers component encoding and form style encoding. They differ in how a space is represented, so choose the convention expected by the next system.

The space and plus sign are different

With component encoding, Ali Ahmed becomes Ali%20Ahmed. A literal plus sign becomes %2B. With form encoding, the space is represented by + instead.

That means a plus sign in form encoded text is not automatically a literal plus. Decoding must use the matching convention or the resulting value can change.

Encode the value that belongs in a parameter, rather than blindly encoding an entire assembled address. Turning every slash and colon into escaped text can stop the result functioning as the URL you intended.

Avoid encoding the same value twice

The percent sign in an already encoded value can itself be encoded. For example, encoding %20 again creates %2520. This often explains why a destination displays an escaped sequence instead of a space.

Keep the original plain value and encode it once at the point where it is inserted into the URL. If you are reviewing existing encoded text, decode one known sample and check its meaning first.

The tool does not visit the URL or determine whether the destination is trustworthy. It transforms text only.

For several parameters, the Query Builder is easier than manually joining encoded values with ampersands. Whichever route you use, compare a value containing a space and a value containing a literal plus before relying on the final link.

Join the conversation

Your email address will not be published. Required fields are marked *

Explore Whatson tool information