Cookies This site keeps only what it needs to work. There is no analytics and no advertising on it today, and nothing here follows you to other sites. Read the privacy policy

Choose what to allow
+92 312 8299940Free Quote
EN – Language: English
Free tool, nothing to install

URL Encoder Decoder
One Value Or A Whole Address

The URL encoder decoder allows you to escape one component of an address. You may also choose to encode the entire address (and leave the slash that separates it intact) or convert an internationalized domain into Punycode and then return it to its original form. Select whether your input is an internationalized domain or an ordinary domain and the encoder/decoder will do the rest.

  • FreePrice
  • 2Scopes
  • NoneSign-up
  • NoneUploads

URL Encoder and Decoder

Percent-encoding and punycode, with each scope kept apart

Characters in
0
Changed
0
Characters out
0

A value inside an address needs every reserved character escaped. A whole address needs its slashes and colons left alone, or it stops being an address.

Ready. Paste something and it converts as you type.

Your browser does all of the work here, in this tab. We upload nothing, store nothing and log nothing.
Add a link to this tool on your own site

Copy the code below and drop it into your page. It places a link to this free tool.

Guides for this tool

Articles with worked examples, tables and a short video that help you get more from this tool.

  • UTM ParametersUTM Parameters

    UTM parameters explained: what each one does, naming conventions, a worked example URL, and GA4 tips.

    9 minutes of reading · video guide inside

  • What Is Base64? A Plain-English ExplanationWhat Is Base64? A Plain-English Explanation

    What is Base64? A plain-English explanation of how it works, where it's used, and the size cost.

    10 minutes of reading · video guide inside

The short version

The Job Percent Encoding Does

Only a very small number of characters can be used safely in a URL. Letters, numbers and a few other punctuation marks.

Everything else is transmitted with a percentage symbol followed by two hexadecimal numbers. Space is replaced with %20, hash with %23, and accented characters are replaced with either two or three of these number pairs.

The rules for URLs are found in the URL Standard, which is what is implemented by browsers. While some older documents refer to RFC 3986, the two are in agreement about the portions of each document that apply to this discussion.

So percent encoding is not compression or security. It is a way of saying "these characters are data, not structure".

The Two Scopes, And Why They Differ

A complete address has to be structured exactly as it was created. Each slash separates a segment of the URL (Uniform Resource Locator) path, each question mark begins the query portion of the URL, and each ampersand separates each parameter within the query.

Diagram of a space, an ampersand and an accented letter in a link turned into percent codes such as %20, %26 and %C3%A9
Unsafe characters become percent codes.

The opposite value inside the same address needs a slash. A slash in a product name is data. Raw data can be read by the server as a new path segment.

This one difference is important because it is a common mistake when you use the wrong function. percent-encoding has two different functions within each programing language.

The Plus Sign Problem

Since HTML forms were first created, the plus sign (+) has been used to represent a space in a query string. When used within a URL path, but, the plus sign (+) remains a plus sign (+).

URL encoder turning a link with a space, an ampersand and an accented letter into percent encoded text
Spaces and symbols turn into codes.

So the same character decodes two ways depending on where it sits. A decoder that guesses is wrong half the time.

The option is yours with this toggle switch. Use the "on" position for everything created from a form, and use the "off" position for paths or fragments.

Double Encoding

A second encoding pass turns %20 into %2520. It happens when a framework escapes a value that already carried escapes. The sign is a percent sign followed by 25 in your logs.

What Never Needs Encoding

RFC 3986 allows just letters, digits and - . _ ~ unescaped. They pass through every encoder unchanged, in every scope.

URL decoder with a percent encoded text pasted in and the readable text with the accent and symbols shown in the output
Turn a link back into readable text.

For everything else, the placement determines the function. The colon is used for structure in a plan and for data within a parameter. Both the at symbol and the comma act similarly.

When in doubt, encode. An over-encoded value still works, while an under-encoded one breaks in ways that only show up with certain inputs.

Where Encoding Goes Wrong In Practice

The most typical way to give a search box is for someone to type a phrase containing an ampersand. Your program takes this phrase and right away puts it into a query string, which will cause your server to see two separate parameters.

URL encoder with the full address scope chosen, so the slashes and question mark stay while only the space is encoded
Full address mode keeps the slashes.

Second, file names. Some servers do not have an issue with a file name containing a space, a hash (#) or a plus (+); but, many other servers will break the download link if you include these characters in your file name. So, the bug can be difficult to reproduce.

Thirdly, the redirect parameter follows. The complete address within another address is treated as a single unit. So, all of its slashes and colons must be escaped.

The use of the appropriate encoding function to encode the value will solve each of these three issues. Do not escape the address but rather escape the value; the URL builder will then be able to compile the remaining components.

URL Encoding and HTML Escaping Are Separate Jobs

Using percent encoding to protect text in an address is good practice. Using HTML entities to protect text within a document is also good practice. But, using percent encoded text in place of HTML entity protected text will result in a functional link that does nothing.

Video guide

How the URL Encoder and Decoder Works, Step by Step

This brief video shows each step from start to finish. Choose your language below, and switch on captions if they help.

How it works

Working With the URL Encoder Decoder, Start to Finish

The first two steps never vary. The third step is the only decision. Every key pressed will produce a result.

  • Paste your text

    One address, one value, or a whole list. Each line converts on its own unless you turn that switch off.

  • Say what it is

    A whole address keeps its slashes and colons. One value escapes everything, because everything in it is data.

  • Set the plus switch

    Turn it on for all forms (where a plus represents a space). Turn it off for paths (where a plus represents a plus).

  • Check the round trip

    Press Move result to the left and convert again. Anything that does not come back unchanged is worth a second look.

Why this one

What Sets This URL Encoder Online Apart

Most converters offer one button and hope. The differences here are the scope switch, the plus switch and the honesty about failure.

  • Two scopes, stated in words

    The menu doesn’t ask you what you want your text to be. It asks what your text is. Most errors start here.

  • The plus sign is your call

    A plus is a space in a query, and a plus in a path. One switch, and no guessing on either side.

  • Line by line

    Paste a hundred addresses and each converts separately, so a list comes back as a list rather than one long string.

  • Real errors, not silence

    The use of a stray percent sign will make decoding impossible. It states this instead of returning the input exactly as is and allowing you to believe the process was successful.

  • A reversible round trip

    Turn over the panes and then do another conversion. If the results are different than what you began with, then there was a problem with the process between the first and second conversions.

  • Nothing leaves your tab

    Every single conversion occurs in your browser; so, none of the query string data (such as tokens, emails, and order numbers) will reach the server.

Good habits

Rules For Encoding Addresses

Most URL bugs come from four or five habits. These eight cover them.

  • Encode values, not addresses. Build the address using each part, escaping every part as you include it. When you encode the complete string that’s when you lose its form.
  • Use the URL object in code. Every existing programming language has a tool to escape the different parts of your string. You are now going to be able to use that tool instead of doing it all on your own.
  • Never encode a value twice. If the incoming value has been encoded, then do nothing with it. To find instances where a "%" was encoded twice, search for %25 in your logs.
  • Keep the fragment out of requests. The # sign will remain in the browser; so, a server cannot view what follows it. For that reason, encoding the content following the # sign for a server is pointless.
  • Watch the ampersand. An unescaped ampersand (&) in the value of an attribute will result in that attribute being split into two. This is the main reason why a query gets cut off.
  • Decode for display only. The user should see the unencoded value while we store the encoded value for use with links/requests. If you store the unencoded value, you run the risk of having to re-encode it at some point.
  • Remember non-ASCII is bytes. An accented letter becomes two percent pairs, an emoji four. That is UTF-8, and a length limit counts the escaped form.
  • Try it with a genuinely messy value. A name with an apostrophe, a slash and a space finds every bug in ten seconds. Guessing which characters appear never does.
Worth avoiding

Six Encoding Mistakes That Break Links

Each of the above results in a link that will work on most input and fail on the interesting ones.

  • Encoding the whole address as a value

    In this case every forward slash and every colon are converted into escapes. The end product is a string which cannot be opened by any browser.

  • Leaving a value raw

    A slash or an ampersand inside of the URL will change how the URL looks to the server. The server can then read something that was never sent.

  • Double encoding on the way through

    The author is attempting to explain how a framework does not need to be "escaped" because the template had already been escaped. The user is then seeing ’%’ signs within the title of the page.

  • Assuming a plus is always a space

    In the path, + keeps its plain meaning. A decoder that replaces every one of them corrupts file names for a living.

  • Encoding the hash for a server

    The portion of the URL that is after the ’#’ symbol will remain on the user’s computer (browser). If you escape a portion of the URL for an HTTP request, the only change you are making to the URL is how long it is.

  • Hand-rolling the escape table

    A replace chain will never miss a character. Use the built-in function, which has been designed to follow the standard and not anyone else’s memory of the standard.

Questions

Encoding Questions People Ask

What sets the two scopes apart?

The component settings will escape each of the reserved characters (symbols, forward-slashes and ampersands). The full URL does not contain any of these escaped characters because they define the structure of the URL.

Why did my address stop working after encoding?

The scope is usually wrong nearly all of the time. When you encode an entire link into a single value, those slashes and colons will turn into escape characters.

Does this url encoder online handle emoji?

Yes. An emoji turns into four percent pairs, because UTF-8 represents the emoji with four bytes. When you decode the emoji, you get back what you put in.

What does %20 mean?

The hex value for "32" (the character code for "space") is 20. Every escape follows this format.

Should I use %20 or a plus for spaces?

All addresses should use %20. Plus (+) can be used in query strings by convention, but, %20 is the proper syntax for all other parts of an address.

Why does the decoder reject some strings?

Because there isn’t a pair of valid hexadecimal characters after the percent symbol, this is not an "escape," and the decoder doesn’t have enough context to work out what was intended.

Does percent encoding protect my site from attacks?

No, it stops characters from being misinterpreted as structural elements, thereby eliminating a specific type of program error. But, it will not prevent anything that you may ultimately do with the resulting data.

Can the Denwix encoder process a full list of URLs in one go?

Yes. Leave the line switch on and paste as many as you like. Each line converts on its own and comes back on its own line.

Why does my address get longer after encoding?

As every escaped character is transformed into three and each non-ASCII character transforms into six (or more), this can be an issue if a service limits the number of characters in a link.

Does the text I paste into this Denwix tool leave my browser?

Your browser performs the conversion in the current tab, so, no tokens or order numbers from your query string will be transmitted to our website.

More free tools

More Tools For Web Addresses

Encoding is one step. These three cover the ones on either side of it.

Ready To Convert Something?

Paste in your text; select a scope; verify the results. There are no fees associated with using the URL encoder/decoder; you do not need an account to use it; all of the characters that you input into the tool will remain local to your computer.

Prefer Denwix on GoogleReview Denwix on Google