URL Encoder / Decoder

Encode text so it is safe to use in a URL, or decode percent-encoded text.

How URL encoding works

URLs safely carry only a limited set of ASCII characters. Other characters — spaces, letters like ş, and reserved characters such as &, ? and = — are written as %XX sequences. Each byte becomes two hexadecimal digits; a letter that takes two bytes in UTF-8 becomes two groups.

Three actions

  • Encode parameter (encodeURIComponent): encodes a query value, including / ? & = :.
  • Encode full URL (encodeURI): encodes a whole address and keeps its structure; / ? & = stay as they are.
  • Decode: turns sequences like %20 and %C5%9F back into readable text. + counts as a space.

Examples

InputActionResult
merhaba dünya & şeker=1Encode parametermerhaba%20d%C3%BCnya%20%26%20%C5%9Feker%3D1
https://a.com/yol dizin?q=şekerEncode full URLhttps://a.com/yol%20dizin?q=%C5%9Feker
%C5%9F%20a+bDecodeş a b

Things to keep in mind

  • Do not encode the same text twice: %20 becomes %2520 and the link breaks.
  • Use encodeURIComponent for parameter values and encodeURI to tidy a full address.
  • An invalid percent sequence (for example a stray %) causes a decode error.

When do you need it?

Links with spaces or non-ASCII letters in query parameters, UTM-tagged ad URLs, API requests and redirect addresses all need encoding. If a link looks broken or contains sequences such as %C5%9F, decoding reveals the original text. It is an everyday task for developers debugging requests and for SEO specialists cleaning up addresses.

Why is a space sometimes %20 and sometimes +?

Both are encoded spaces, used in different places. In the path part of an address (for example /files/new%20report.pdf), a space is written as %20. In query strings sent by web forms, a space is traditionally shown as a + sign: ?q=percentage+calculator.

JavaScript's encodeURIComponent always turns a space into %20. If a server does not read + as a space, or you need to send an actual + character, encode it as %2B.

Frequently asked questions

What is URL encoding?

It is writing characters that are unsafe or reserved in URLs as %XX sequences. A space becomes %20 and "ş" becomes %C5%9F.

What is the difference between encodeURIComponent and encodeURI?

encodeURIComponent encodes a single parameter value, including characters such as / ? & =. encodeURI encodes a whole address and leaves those separators alone.

Why is + decoded as a space?

Form data writes spaces as +. When decoding, the tool turns + into a space; a real plus sign should be written as %2B.

Is my data sent to a server?

No. Encoding and decoding happen entirely in your browser.