URL encode
Percent-encode strings for safe use in URLs, or decode them back.
OutputValid
https%3A%2F%2Ftextgen.app%2Fsearch%3Fq%3Dlorem%20ipsum%26n%3D5
Percent-encode strings for safe use in URLs, or decode encoded URLs back to plain text. Runs entirely in your browser.
Frequently asked questions
- What is percent-encoding (URL encoding)?
- Percent-encoding converts characters not allowed in URLs into % followed by two hex digits. For example, a space becomes %20 and & becomes %26.
- When should I use encodeURIComponent vs encodeURI?
- Use encodeURIComponent for individual query parameter values — it encodes everything including /, ?, and &. Use encodeURI for a full URL string where you want to preserve its structure.