URL Encoder / Decoder

Percent-encode text for safe use in URLs, or decode an encoded string back to readable form.

Encoding a component vs a full URL

encodeURIComponent() escapes everything that could break a URL — including /, &, = and ?. Use it for individual values such as a search term or a redirect parameter. encodeURI() leaves those structural characters alone because they are meant to be there; use it when you have a complete URL and just need to fix spaces and non-ASCII characters.

Why spaces become %20 (or +)

A URL may not contain a literal space. In paths it becomes %20; in form-encoded query strings it is often written as + instead. This difference is a classic source of bugs — a server reading a query string needs to treat + as a space, while a path segment should not.

Characters that always need encoding

Decoding safely

Decoding is more forgiving than encoding, but a stray % not followed by two hex digits will throw an error. This tool catches that and tells you, rather than silently returning nothing.