URL Encoder
Encode reserved characters in URLs so they're safe to embed in query strings or paths. Donfig offers two modes: encodeURIComponent (encodes everything reserved, the right choice for query parameter values) and encodeURI (preserves the structural delimiters of a full URL). The toggle "Encode reserved chars (component)" controls the mode. Useful for building shareable links, escaping user input before constructing a URL, or debugging URL parsing issues.
JavaScript is required to use the live tool. Please enable JavaScript and reload.
Frequently asked
When should I use encodeURIComponent vs encodeURI?
Use encodeURIComponent for individual query values or path segments. Use encodeURI when you have a full URL (https://...) and want to preserve : / ? &.
Why are some characters not encoded?
RFC 3986 leaves alphanumerics and a small set of unreserved punctuation (- _ . ~) un-encoded. Donfig follows the spec.
Will this work for non-Latin characters?
Yes. UTF-8 multibyte sequences are encoded as %XX%XX% per byte, the standard form.