URL-encode or decode text
Percent-encode text for URLs (encodeURIComponent or encodeURI) or decode an encoded string.
0 / 500,000 characters · Updates as you type.
URLs can only carry a small set of ASCII characters. Everything else, including spaces, ampersands inside a value, Arabic letters and emoji, must be written as percent-encoded UTF-8 bytes: a space becomes %20, "&" becomes %26, "é" becomes %C3%A9. Getting this wrong produces broken links, "400 Bad Request" responses or query parameters that silently split in two.
There are two correct choices depending on what you are encoding. encodeURIComponent escapes everything that is not a letter, digit or - _ . ! ~ * ' ( ), which is right for one value that will be placed into a query string. encodeURI leaves the characters that give a URL its structure (: / ? # & = +) untouched, which is right when you already have a whole URL and only need to fix the illegal characters inside it. Decoding reverses either.
How to use it
- Pick Encode or Decode.
- For encoding, choose encodeURIComponent for a single parameter value or encodeURI for a whole URL.
- Turn on "+ for spaces" only when working with HTML form data (application/x-www-form-urlencoded).
- Paste the text. The output updates as you type; copy it into your code or address bar.
Frequently asked questions
Why is my & still there after encoding?
You used encodeURI, which keeps & because it separates parameters in a URL. If the & is part of a value (a company name, a search term), switch to encodeURIComponent.
Should spaces be %20 or +?
%20 is correct everywhere in a URL. + means space only inside form-encoded bodies and query strings produced by HTML forms; some servers accept it, some do not. Use %20 unless you know the receiver expects +.
Decoding failed with an error. Why?
The text contains a percent sign not followed by two hex digits (for example "100%") or a byte sequence that is not valid UTF-8. Encode the stray % as %25 first.
Does the tool encode non-Latin text correctly?
Yes. Characters are converted to UTF-8 bytes before percent-encoding, which is what browsers and every modern server expect.
Related tools
- Encode or decode Base64Encode text to Base64 or decode Base64 back to text, UTF-8 safe, with a URL-safe option.
- Format, beautify or minify JSONPretty-print or minify JSON with 2-space, 4-space or tab indentation and optional key sorting.
- Decode a JWT (without sending it anywhere)Decode a JSON Web Token's header and payload and see whether it has expired. Signature is not verified; the token stays in your browser.
- Generate a QR code (PNG or SVG)Turn a URL or text into a QR code and download it as PNG or SVG. Generated locally; nothing is uploaded.