URL encoding · %20 and friends

URL encoder and decoder

A space, an & or a Hindi word in the wrong place can break a link. Encode a value before you put it in a query string, or decode a long tracking link full of %2F and %3D to see what it really says. Choose whether to encode one part of a URL or a whole URL.

How to use the tool

  1. 1

    Choose the mode

    “Part of a URL” (encodeURIComponent) is for one query value or path segment. “Whole URL” (encodeURI) keeps : / ? & = so the link still works.

  2. 2

    Encode a value

    Type the text in the Text box, for example chai & samosa. The encoded version, chai%20%26%20samosa, appears alongside.

  3. 3

    Decode a link

    Paste an encoded URL into the URL box to read it. Turn on “Decode + as a space” for form data and some search links.

  4. 4

    Copy it back

    Copy the result into your code, spreadsheet or campaign builder.

QRScanKaro

Share it as a QR code

Got a link, a Wi-Fi password or a message to share? Turn it into a QR code with your colours and logo, free, in your browser.

Open the QR generator →

Frequently asked questions

What is the difference between %20 and + for a space?

Both can mean a space. %20 is standard percent-encoding and works everywhere in a URL. + means a space only in form data and query strings sent the HTML-form way. When decoding such data, switch on “Decode + as a space”.

Why does my link break when a value contains &?

In a query string, & separates parameters, so an unencoded & in a value starts a new parameter. Encode the value with “Part of a URL” first, and & becomes %26.

When should I use encodeURI instead of encodeURIComponent?

Use encodeURI on a complete URL that you only want to make safe, such as one with spaces. Use encodeURIComponent on a single value you are inserting into a URL, because it also escapes / ? & = and #.

What does “broken escape” mean?

A % must be followed by two hex digits, like %2F. A lone %, or % followed by other characters, cannot be decoded. The message shows the part that is wrong so you can fix or remove it.