URL Encode & Decode
Percent-encode text for a URL, or decode an encoded URL back to text.
Runs in your browser — nothing is uploaded
Component mode escapes everything except A–Z a–z 0–9 - _ . ! ~ * ' ( ), including / ? & = #.
Encoded
caf%C3%A9%20%26%20croissants%20%3D%202%20%C3%97%20%E2%82%AC3.50%3F
How to use URL Encode & Decode
- 1
Choose Encode or Decode.
- 2
Choose Component (query value) to encode a single parameter value, or Full URL to encode a whole address and keep its structure.
- 3
Type or paste your text; tick Spaces as + (or Treat + as space when decoding) for HTML form data.
- 4
Select Copy to copy the result, or Swap to send it back through the other way.
About this tool
URLs may only contain a limited set of ASCII characters. Anything else, including spaces, accented letters and characters with special meaning such as & and =, has to be percent-encoded: the character is converted to UTF-8 bytes and each byte is written as % followed by two hex digits. A space becomes %20 and é becomes %C3%A9.
Component mode matches JavaScript's encodeURIComponent. It escapes everything except letters, digits and - _ . ! ~ * ' ( ), including / ? & = and #, so use it for one query-string value or path segment, where those characters must not break the URL. Full URL mode matches encodeURI: it leaves the characters that give a URL its structure alone and only escapes the rest, so it suits a complete address that contains spaces or non-ASCII text.
HTML forms submitted with application/x-www-form-urlencoded write spaces as + instead of %20. Tick Spaces as + to produce that format, or Treat + as space to decode it. When decoding, a % that is not followed by two hex digits, or bytes that are not valid UTF-8, produce a clear error rather than a half-decoded result.
Encoding and decoding happen in your browser; nothing is sent to a server.
Questions people ask
What is %20 in a URL?
%20 is an encoded space. The space character has byte value 32, which is 20 in hexadecimal.
Should I use encodeURI or encodeURIComponent?
Use encodeURIComponent (Component mode) for a single parameter value, and encodeURI (Full URL mode) for a whole URL you want to keep working.
Why is a space sometimes + and sometimes %20?
HTML form submissions encode spaces as +, while the general URL standard uses %20. Both are common in query strings.
Why do I get a malformed URI error when decoding?
The text contains a % that is not followed by two valid hex digits, or the bytes do not form valid UTF-8. Check for a stray % sign.
Related tools
- Base64 Encode & DecodeEncode and decode Base64 text, or turn any file into a data URL.
- HTML Entity Encoder & DecoderEscape text for safe use in HTML, or turn HTML entities back into characters.
- JSON FormatterBeautify, minify and validate JSON, with errors pinpointed to the line.
- Hash GeneratorCalculate MD5 and SHA hashes of text or a file, and check a checksum.
- JWT DecoderPaste a JWT to read its header, payload and expiry time.
- Regex TesterWrite a regular expression and see every match and group highlighted live.