Skip to content · 跳到主要内容

URL Encode Decode Calculator

Free url encode decode calculator with a clear formula and instant result

Enter text

Result
--
--
Output length

URL Encode Decode

Percent-encode a query value or decode a URL component locally.

encoded = encodeURIComponent(text)

When encoding is required

Percent-encoding replaces characters that carry a reserved meaning in a URL, or that cannot be transmitted safely, with a percent sign followed by two hexadecimal digits. A space becomes %20, and symbols such as ampersand, equals and question mark must be encoded when they are part of a value rather than part of the URL structure. Unreserved letters, digits, hyphen, underscore, dot and tilde are left untouched.

Encoding a whole URL versus one value

There is an important difference between encoding a single query value and encoding a complete URL. Encoding an entire URL also encodes its separators, which breaks the structure. Use component mode for one parameter value, and if a full URL has to be embedded inside another one, encode it as a value so its own separators survive. Decoding reverses the percent escapes, including multi-byte UTF-8 sequences, which appear as several consecutive escapes rather than one.

Frequently Asked Questions

What does %20 mean?

It is a percent-encoded space. A space cannot appear literally in a URL, so it is written as the escape sequence %20.

Why does one Chinese character produce several escapes?

UTF-8 encodes it as multiple bytes, and each byte becomes one percent escape, so a single character can take three or more.

Should I encode an entire URL?

Usually not, because encoding everything escapes the separators too. Encode individual parameter values instead.

Is the text sent to a server?

No. Encoding and decoding both run locally in your browser.

Last reviewed: October 5, 2026 · How we calculate · Sources: Published formula reference; verify domain-specific assumptions before making a decision