Free developer tool

URL Encoder and Decoder

URL encoding replaces unsafe characters with a percent sign and two hex digits so a link works everywhere. Paste text to encode or decode it.

Report a problem or suggest a fix for this tool

What is url encoder and decoder?

URLs can contain only a limited set of characters. Spaces, ampersands and non English letters must be encoded when they appear in query strings or paths.

Use encode for values you add to a link, and decode when you want to read a link copied from a browser or log.

How to use the url encoder and decoder

  1. Choose encode or decode.
  2. Tick the full URL box if the input is a complete link.
  3. Press Calculate and copy the result.

How the url encoder and decoder works

Encoding uses the standard percent encoding of UTF 8 bytes. For a full URL, characters that have meaning in a URL such as colon, slash and question mark are kept.

Worked example

coffee & tea becomes coffee%20%26%20tea.

Common uses of the url encoder and decoder

  • Adding a search phrase or email address to a query string.
  • Reading a long tracking link copied from a browser.
  • Fixing links that break because of spaces or symbols.
  • Building redirect and API request URLs.
  • Debugging double encoded values.

Tips and common mistakes

Encode each query value separately, then join them with ampersands.

Double encoding is a common bug. If you see %2520, the text was encoded twice.

Background: what to know before you rely on it

URLs may only contain a small set of letters, digits and symbols. Everything else is replaced by a percent sign followed by the two hex digits of the byte, so a space becomes %20. Non English letters are first turned into UTF 8 bytes and each byte is encoded, which is why a single accented letter can become six characters. Some characters have special meaning, such as question mark, ampersand and equals, so they must be encoded when they are part of a value. A plus sign in a query string often means a space in forms, which is another source of confusion. Always encode values, not the whole URL, unless you know you need to.

Private, free and fast

This tool runs entirely in your browser. What you type or choose is not uploaded to a server and is not saved after you close the page, which keeps it fast and private. It is free to use as often as you like. See more in all developer tools, or browse the full list of tools.

Field by field guide

  • Action: Choose one of: Encode; Decode.
  • Treat input as a full URL (keep : / ? & =): Tick to turn this option on.
  • Input: Type or paste your text here. Use a new line for each entry where the label says so.

Change one field at a time to see how the result responds, and use the worked example above to check that you get the same answer.

Encoding URLs safely

URLs allow only certain characters. Others are replaced with a percent sign and a hex code, so a space becomes %20.

Expert tips

  • Encode query values, not whole URLs, or you will break the separators.
  • Reserved characters such as ?, &, = and # have special meaning.
  • Use UTF8 for non English letters, which become several encoded bytes.
  • A plus sign means space only in form encoded query strings.
  • Decode to read logs and tracking links.

Incorrect encoding is a common cause of broken links and failed redirects.

Frequently asked questions

What is %20?

A space.

What is the difference between encodeURI and encodeURIComponent?

The first keeps URL structure characters. The second encodes them too.

Why decode a URL?

To read the original text.

Guides that go with this tool

Embed this tool on your website

Copy the code below and paste it into your page or blog post. The tool is free to embed, runs in the visitor's browser and needs no account. Please keep the credit link.

Related tools

Results are for information and education. For legal, financial, medical or security decisions, check with a qualified professional. Do not paste live secrets into any website.