URL Encoder and Decoder
Percent-encode text for use in a URL, such as hello world → hello%20world, or decode it back. Choose between encoding a single value and a whole URL.
Runs in your browser. Your data is not uploaded.How our tools work
Encodes everything except letters, digits and - _ . ! ~ * ' ( ), including / ? & = and #, so the value can sit safely inside a URL (encodeURIComponent).
How do I URL-encode or decode text?
Choose Encode and type your text: spaces and special characters become percent-escapes, so hello world becomes hello%20world. Choose Decode to turn them back. For a value inside a URL, such as a search term, keep “Part of a URL”; for a complete address, choose “A whole URL”. Malformed input is explained.
Not sure which characters need encoding, or why a space is sometimes a +? Read our guide: How to Encode and Decode URLs: Percent-Encoding Explained
Key features
Parts of URLs or whole URLs
Encode a value with encodeURIComponent, which also encodes / ? & = and #, or a whole address with encodeURI, which keeps them.
No silent double encoding
If your text already contains escapes such as %20, you’re warned that encoding it again would turn %20 into %2520.
Form data
When decoding, optionally read + as a space, as HTML forms send it.
Common uses
- Build a link with a search term or other value in it
- Read an encoded URL from a log, email or redirect
- Encode text for an API request
Encoding a part or the whole URL
A URL uses characters such as / ? & = and # to separate its parts. Inside a value, they must be encoded, or they would change the URL’s meaning: a search for “fish & chips” needs & written as %26. That is what “Part of a URL” does.
When encoding a complete address, those characters must stay as they are, so “A whole URL” only encodes spaces and characters that aren’t allowed in URLs.
Frequently Asked Questions
Why is a space %20 and sometimes +?
In URLs a space is %20. HTML forms send spaces in query strings as +. When decoding form data, turn on “Treat + as a space”.
What does %2520 mean?
Text that was encoded twice: %20 was encoded again, and % became %25. Decode it twice to get the original.
Why can’t %ZZ be decoded?
A % must be followed by two hexadecimal digits (0–9, A–F). %ZZ isn’t a valid escape, so it may be a typo or a literal percent sign that should be written %25.
Sources
Last updated:
Related guides & tutorials
How to Encode and Decode URLs: Percent-Encoding Explained
How percent-encoding works, which characters need it, encoding a value vs a whole URL, %20 vs +, and the mistakes that break links and query strings.
How to Create SEO-Friendly URL Slugs
Write clean URL slugs: lowercase, hyphens, no punctuation, accents and other scripts, sensible length, good and poor examples, and changing slugs safely.
JSON Syntax Errors Explained, and How to Fix Them
JSON syntax explained with valid and invalid examples: formatting vs minifying, indentation, and how to fix trailing commas, single quotes and other errors.