Skip to content
MoneyDeck

URL Encode / Decode

Percent-encode or decode URLs, query strings and form data correctly

Updated · Free, no signup

Result

Tom%20%26%20Jerry%3A%2050%25%20off!%20caf%C3%A9%3F

Status

Encoded

Percent-escapes in encoded text

11

Input length

27 characters

Output length

50 characters

Query parameters found

0

About the URL Encode / Decode

This URL encoder and decoder converts text to and from percent-encoding, the format URLs use for spaces, symbols and non-English characters. Encoding turns a character like a space into %20 and é into %C3%A9 (its UTF-8 bytes); decoding reverses it so you can read a mangled link, a redirect parameter or a tracking URL.

Choose the method that matches where the text is going. Component mode (like JavaScript’s encodeURIComponent) is right for a single query value or path segment. Full-URL mode (encodeURI) keeps :/?#&= intact so an entire address stays usable. Strict RFC 3986 mode also escapes ! ' ( ) *, and form mode produces application/x-www-form-urlencoded data with spaces as + as HTML forms and URLSearchParams do.

When the result contains a query string, each parameter is listed separately with its decoded value — handy for inspecting UTM tags, OAuth callbacks and API requests. Everything runs locally in your browser.

How to use the url encode / decode

  1. 1Choose Encode or Decode.
  2. 2Pick the method: Component for a single value, Full URL for a whole address, Form for POST bodies.
  3. 3Paste your text or URL into the input box.
  4. 4Copy the result, and check the parameter table for query strings.

Formula and method

unsafe character → UTF-8 bytes → %HH for each byte

Percent-encoding (RFC 3986) represents a character that is not allowed, or has a special meaning, in part of a URL by converting it to its UTF-8 bytes and writing each byte as % followed by two hexadecimal digits. A space (byte 0x20) becomes %20, & becomes %26, and é (bytes C3 A9) becomes %C3%A9. Unreserved characters — letters, digits and - . _ ~ — are never encoded.

The methods differ only in which reserved characters they leave alone: encodeURIComponent escapes everything except A–Z a–z 0–9 - _ . ! ~ * ' ( ); encodeURI additionally keeps ; , / ? : @ & = + $ #; strict RFC 3986 escapes ! ' ( ) * as well; and form encoding follows the WHATWG URL standard, writing spaces as +. Decoding converts each %HH back to a byte and reads the bytes as UTF-8.

Worked examples

Encode a query value

Spaces, &, :, % and ? all have meaning in a URL, so each becomes a %XX escape; é becomes two escapes (%C3%A9) because it is two UTF-8 bytes. The exclamation mark is left as-is by encodeURIComponent. 27 characters grow to 50.

Encode a whole URL

Full-URL mode keeps the structure — :// / ? & = and # — and only escapes the space, so the link still works. The two query parameters q and lang are listed in the table.

Form-encode a field

In application/x-www-form-urlencoded data spaces become +, while = and & are escaped so they are not mistaken for separators. í is two UTF-8 bytes, giving %C3%AD.

Decode a redirect parameter

Redirect and tracking URLs often carry an entire encoded URL as a parameter. Decoding reveals https://moneydeck.io/tools?q=mortgage+calculator&page=2, and the table shows q = "mortgage calculator" and page = 2.

Frequently asked questions

What is the difference between encodeURI and encodeURIComponent?+

encodeURI is for a complete URL and leaves characters with structural meaning (: / ? # & = + and more) alone. encodeURIComponent is for one piece, such as a query value, and escapes those characters too so they cannot break the URL.

Should a space be %20 or +?+

In paths and in RFC 3986 encoding, a space is %20. In HTML form data (application/x-www-form-urlencoded), which most query strings use, a space may be written as +. Decoders for query strings treat both as a space.

Why do accented letters become several % codes?+

URLs are encoded as UTF-8 bytes, and characters outside basic ASCII take 2–4 bytes. é is C3 A9, so it becomes %C3%A9; an emoji becomes four escapes such as %F0%9F%98%80.

What does “URI malformed” or invalid percent-encoding mean?+

A % sign was not followed by two hex digits, or the escapes do not form valid UTF-8 (for example %E9 alone, which is Latin-1). Encode a literal percent sign as %25.

How do I fix double-encoded URLs like %2520?+

%25 is an encoded %, so %2520 is a %20 that was encoded a second time. Decode it twice to get a plain space; then fix the code that encodes an already-encoded value.

Related tools