Skip to tool

URL Encoder and Decoder

Percent-encode or decode URL text using component, path, query, fragment, or userinfo rules.

Runs in your browser — your input is processed on this device and never uploaded.

Input

Result

Results appear here.

About this tool

On this page

What is percent-encoding?

Percent-encoding, defined in RFC 3986, writes a byte as a percent sign followed by two hexadecimal digits. A space becomes %20. It exists so that characters with a structural job in a URL can also appear as ordinary data without breaking the URL apart.

URL encoder options

Operation
Encode (the default) percent-encodes UTF-8 text. Decode turns encoded octets back into text.
Text
The text to encode or decode.
URL part
Component (the default), Path, Query, Fragment or User info. It picks which context you are encoding for, and is ignored when decoding.

Why the URL part matters

Different parts of a URL reserve different delimiters. A slash is structure in a path and ordinary data in a query value. An ampersand separates parameters in a query and means nothing special in a fragment.

So there is no single correct escaping. Encode a value with path rules and drop it into a query string, and you can leave an ampersand unescaped that splits your parameter in two. Picking the set that matches where the value is going is the whole point of the option.

URL encoding alternatives

Percent-encoding is not the same as application/x-www-form-urlencoded, and this tool does the former. A plus sign is not treated here as a universal stand-in for a space, so form payloads that rely on that convention need a form encoder instead.

For binary data rather than URL text, use Base64, Base32, Hex or Ascii85. Percent-encoding arbitrary bytes works but triples the size of anything non-ASCII.

Things to know about percent-encoding

Decoding is not context-sensitive the way encoding is, which is why the URL part option is ignored then. A %2F is a slash regardless of which part of the URL it came from.

Warning

Encoding an already encoded value is the classic mistake. The percent signs themselves get encoded, %20 becomes %2520, and the damage is invisible until something downstream decodes once and hands on a string that still contains %20.

Browse

Find similar tools by category or tag.