Skip to main content
短.be

URL Encoder / Decoder

Paste a URL or any text to convert it to percent-encoding (encode) or restore it to readable characters (decode), instantly.

Your input is processed inside your browser and is never sent to a server.

Conversion mode

Same as encodeURIComponent. Converts every reserved character including / ? & = #, so use it for strings embedded inside a URL, such as query parameter values.

What this tool does

URLs cannot contain spaces or characters outside a limited ASCII set, so those characters must be converted to percent-encoding (URL encoding) such as %20. This tool encodes and decodes strings instantly, entirely inside your browser.

There are two encode modes. Component mode converts every reserved character including / ? & = #, which is what you need when embedding a value such as a search keyword into a query parameter. Full URL mode keeps the structural characters intact, which is what you need when preparing a complete URL for sharing.

Decode restores a percent-encoded URL to a readable form. It is handy when you want to inspect a long encoded URL found in an email or a log file.

How to use

  1. Choose the conversion type

    First pick what you want to do. Choose Encode (component) to embed a string inside part of a URL, Encode (full URL) to tidy up a whole URL while keeping its structure, or Decode to turn percent-encoded text back into readable characters.

  2. Enter the string to convert

    Paste your URL or text into the input box. Even strings with spaces or non-English characters are converted on the spot according to the mode you picked.

  3. Check the result and copy it

    The result box updates automatically as you type. Use the copy button to grab the output and paste it straight into a link or a query parameter value.

  4. Switch modes and compare if needed

    If the result is not what you expected, switch the conversion type. Compare whether the reserved characters were converted and whether the URL structure stayed intact, then pick the mode that fits your purpose.

How percent-encoding works

What percent-encoding is

Only letters, digits, and a limited set of symbols can appear in a URL directly. Characters that cannot, such as spaces or non-English letters, are replaced with percent-encoding, where each byte is written as a percent sign followed by two hexadecimal digits.

A space, for example, becomes %20, and a single Japanese character becomes three bytes such as %E3%81%82. Decoding is the reverse: it reads the percent notation and restores the original characters.

The difference between component and full URL

Component mode matches encodeURIComponent and converts every delimiter, including / ? & = #. Even if a value contains one of these symbols, it is treated as a single value rather than mistaken for a separator.

Full URL mode matches encodeURI: it leaves the delimiters that shape a URL, such as the slash, question mark, and colon, in place while converting spaces, non-English characters, and a few symbols. It suits tidying a complete URL that starts with https:// into a shareable form without breaking its shape. Note that running it again on an already-encoded URL double-encodes it, turning %20 into %2520, so apply it to a URL that has not been encoded yet.

Encoding and decoding are reversible

A string you encode can be restored exactly by decoding it with the same rules. The conversion itself never loses information.

Decoding does assume that every percent sign is followed by two hexadecimal digits, though. A URL cut off partway, or one that contains a bare percent sign, is invalid notation and cannot be restored, so it raises an error.

Frequently asked questions

When should I use component mode versus full URL mode?

It depends on where the string goes. Use component mode for a string embedded inside a URL, such as a query parameter value. Use full URL mode when converting a complete URL that starts with https://.

Why does decoding fail with an error?

A string is invalid percent notation when a % is not followed by two hexadecimal digits. This often happens with URLs that were cut off midway or strings containing a raw, unencoded % sign.

Is my input sent to a server?

No. All conversion happens inside your browser, and your input never leaves your device.

I accidentally encoded a URL twice. Can I get it back?

Often yes, by decoding twice. In double encoding the percent sign itself becomes %25, so decode once to turn %25 back into a percent sign, then decode again to recover the original string.

Why does a whole URL encoded in component mode fail to open as a link?

Applying component mode to a full URL also converts the :// in https://, which breaks the link structure. Use full URL mode to tidy a complete URL, and keep component mode for parts such as query parameter values.

Related terms

Was this tool helpful?