๐Ÿ”— URL Encoder / Decoder

Turn text into percent-encoding such as %20 or %E4%B8%AD, and turn it back into something readable. Handles both component and full-URL encoding, plus a query-string inspector.

๐Ÿ” Query-string inspector

ParameterRaw valueDecoded value
Paste a URL with parameters and each one will be listed here.

Note: everything after ? is the query string, and everything after # is a fragment that is never sent to the server โ€” so the fragment is ignored here.

๐Ÿ“– Common characters and their encodings

CharacterPercent-encodingWhy it must be encoded

The rule: a URL may safely contain letters, digits and - _ . ~. Everything else becomes % plus two hexadecimal digits. Non-ASCII text is encoded byte by byte in UTF-8, so one Chinese character (3 bytes) becomes three %xx groups and an emoji (4 bytes) becomes four.

How to use the URL Encoder and Decoder

Percent-encode or decode a string to handle Chinese characters, spaces and special characters safely inside a URL.

How it works

Percent-encoding converts each byte to its two-digit hexadecimal representation preceded by a percent sign. A Chinese character occupies three bytes in UTF-8, so it becomes three escapes: ไธญ becomes %E4%B8%AD. A space may be written as %20 or as +, and which one is correct depends on whether the string sits in a query string or a path.

When to use it

Use it to build a query string with non-ASCII values, read an encoded address pasted from elsewhere, debug why a request returns unexpected parameters, or verify a callback URL.

Worked example

Common characters and their encodings:

CharacterEncodedNote
ไธญ%E4%B8%AD3 bytes in UTF-8
A%41single byte
space%20 or +depends on context
&%26must be encoded in values
+%2Bmeans literal plus, not space

Assumptions and limitations

Both ends must agree on the character encoding; UTF-8 versus GBK is the usual cause of garbled text. Do not build URLs containing Chinese by hand, use a library. Characters after # never reach the server. Double-encoding is a frequent bug when already-encoded values are passed through a second encoder. This tool does not parse or validate full URL syntax.

Frequently Asked Questions

What is the difference between encodeURIComponent and encodeURI?

encodeURIComponent is meant for a single piece of data such as one parameter value: it encodes / ? : # & = + and everything else except letters, digits and - _ . ! ~ * ' ( ). encodeURI is meant for a whole link: it deliberately leaves those structural characters alone so the URL stays valid. Using the wrong one is easy to spot โ€” encoding a full address with encodeURIComponent turns https:// into https%3A%2F%2F.

Why is a space sometimes %20 and sometimes +?

%20 is the standard percent-encoding for a space. The plus sign is a legacy HTML form convention (application/x-www-form-urlencoded) that treats + as a space on submission. Both appear in the wild; the difference is whether the decoder converts + back to a space, which form handlers do and path handlers do not. Tick the box above to output or interpret the form style.

Why does decoding fail with an incomplete escape sequence?

Because a % was not followed by two hexadecimal digits โ€” a lone %, %2 or %ZZ. That usually happens when a link is truncated during copy, or when a literal percent sign was put in the URL without first encoding it as %25. Fix it by locating the stray % and replacing it with %25, or by running the text through Encode mode first.

Do I need to encode a URL I put in an href attribute?

Not the whole thing โ€” encode the parts that carry data. Slashes and the scheme must stay readable, and modern browsers handle non-ASCII in paths reasonably well, but query parameter values, filenames with spaces and anything containing &, ? or # should be percent-encoded to survive every server and proxy. Encode the value, then assemble the URL around it.

๐Ÿ›’ Recommended for You

As an Amazon Associate, Benditools earns from qualifying purchases.