Skip to main content
Everyday Tools

URL Encoder & Decoder

URLs can only contain a limited set of characters. Spaces, symbols and non-English letters have to be converted into percent-encoded form, such as %20 for a space. This tool encodes text for safe use in a URL and decodes encoded strings back to plain text.

Last reviewed:

encodeURIComponent: encodes everything except letters, digits and - _ . ! ~ * ' ( )

Choose between encoding a single value (such as a search query) and encoding a whole URL while keeping its structure. Conversion happens as you type and never leaves your browser.

How to use this calculator

  1. Choose the conversion: encode or decode, for a single value or a whole URL.
  2. Paste or type your text in the input box.
  3. Read the result below, or fix the error message if the input is invalid.
  4. Use Copy result to copy it.

Formula and variables

Each unsafe character is written as % followed by the hexadecimal value of each byte of its UTF-8 form. Space → %20, & → %26, é → %C3%A9

  • Encode (value) - encodeURIComponent: also encodes / ? & = # : so a value cannot break the URL.
  • Encode (whole URL) - encodeURI: keeps those structural characters so the link keeps working.

Worked example

Encode a search phrase to use as a query value.

Inputs and results for the worked example
Textchai & samosa/₹50
Encodedchai%20%26%20samosa%2F%E2%82%B950
  1. Spaces become %20 and & becomes %26.
  2. The slash becomes %2F so it is not treated as a path separator.
  3. The rupee sign is three bytes in UTF-8, so it becomes %E2%82%B9.

What changes the result

  • Value or whole URL. Encoding a whole URL as a value would also encode the :// and slashes, which breaks the link.
  • Double encoding. Encoding text that is already encoded turns % into %25. Decode first if unsure.
  • Plus signs. In forms a + can mean a space. This tool uses %20, which is correct everywhere in a URL.
  • Unicode. Characters outside English are encoded as UTF-8 bytes.

Benefits and practical uses

  • Build safe links and query strings.
  • Read encoded URLs from logs and emails.
  • Handles Hindi and other scripts.

Assumptions and limitations

  • Uses your browser's standard encodeURI and decodeURI functions with UTF-8.
  • Invalid percent sequences show an error instead of producing partial output.
  • Nothing is uploaded.

Frequently asked questions

What is URL encoding?

Replacing characters that are not allowed in a URL with a % sign and their hexadecimal byte values.

What does %20 mean?

It is an encoded space.

What is the difference between the two encode options?

Value encoding converts everything unsafe, including / ? & and =. Whole-URL encoding keeps those so the URL structure stays intact.

Why do I get an invalid sequence error?

Decoding fails when a % is not followed by two hexadecimal digits, or the bytes do not form valid UTF-8.

Can I decode a link in Hindi?

Yes. Encoded Devanagari such as %E0%A4%A8 decodes back to the original letters.

References

Page last reviewed on . This calculator gives estimates for planning only; it is not financial advice and not an offer from any lender.