← All posts
2 min readBy

How to URL Encode and Decode Text (With Examples)

Turn spaces and special characters into %20-style codes for query strings, or decode them back. Free tool in your browser, plus the JavaScript one-liners.

How to URL Encode and Decode Text (With Examples)

Quick answer: open the URL Encoder / Decoder, paste your text, and tap Encode or Decode. Spaces become %20, and characters like & or = become safe codes so a link does not break. Everything runs in your browser; nothing is uploaded.

Why URLs need encoding

A web address can only use a limited set of characters safely. A space, a non-English letter, or a character that already means something in a URL (&, =, ?, #) must be written as a % code. That process is URL encoding (also called percent-encoding). Decoding turns those codes back into readable text.

Step by step (no code)

  1. Open the URL Encoder / Decoder.
  2. Paste the text (for example a search phrase or a full link).
  3. Tap Encode to get the percent-encoded form, or Decode to reverse it.
  4. Copy the result into your app, spreadsheet or address bar.

Common examples (tested)

Input Encoded (encodeURIComponent)
hello world hello%20world
a&b=c a%26b%3Dc
café caf%C3%A9

A full URL is different: you usually want to keep :// and / readable. In JavaScript that is encodeURI, which leaves those characters alone:

encodeURI("https://saveanyreel.com/search?q=hello world");
// → "https://saveanyreel.com/search?q=hello%20world"
encodeURIComponent("hello world"); // "hello%20world"
decodeURIComponent("hello%20world"); // "hello world"

These one-liners were run in Node before publishing this guide.

What this tool cannot do

  • It does not shorten links or create QR codes (use the QR Code Generator or WhatsApp link tool).
  • It does not fix a broken website; it only encodes or decodes text.
  • An invalid % sequence (for example %ZZ) cannot be decoded; the tool will say so.

FAQ

What is URL encoding? It turns spaces and special characters into safe % codes so a web address does not break. Decoding turns those codes back into readable text.

encodeURI vs encodeURIComponent? Use encodeURIComponent for a single query value. Use encodeURI when you want a full URL to keep :// and / readable.

Does the tool upload my text? No. Everything runs in your browser.

Related

Try it: URL Encoder / Decoder →