About URL Encoder / Decoder
Encode and decode URLs in either <code>encodeURIComponent</code> or <code>encodeURI</code> semantics. Paste a full URL and the dissection panel breaks it into protocol, host, port, path, query, and hash — query parameters render as editable key/value rows. Batch mode handles one URL per line.
What URL encoding is
A URL is ASCII. Anything outside ASCII — most of human language, and a long list of reserved punctuation — has to be percent-encoded so the URL stays parseable across servers, proxies, and logs. The encoding is byte-level: each non-safe byte becomes %HH (two hex digits).
Two encoders, two contexts:
encodeURI— encodes a complete URL. Leaves URL syntax characters intact.encodeURIComponent— encodes a single component (a query value, a path segment). Encodes everything except unreserved characters.
When in doubt, use encodeURIComponent — it cannot produce a wrong-by-default URL when used on the right input, while encodeURI quietly fails when you give it a value that contains URL syntax.
URL parts panel
Paste any URL and the parser breaks it down:
https://api.example.com:8080/v1/users?role=admin&active=true#section
───── ─────────────── ──── ──────── ────────────────────── ───────
proto host port path query hash
The query becomes a table of key/value rows you can edit. The reconstructed URL re-emits with proper encoding on every change.
Common workflows
Build a tracking link safely. Compose ?utm_source=...&utm_medium=...&q=... with values that contain spaces, ampersands, or non-ASCII. Drop them in the editable rows and copy the encoded URL back out.
Decode a redirect target. Open a URL with ?next=https%3A%2F%2F.... Paste here, the inner URL surfaces clean.
Inspect a webhook target. Long encoded URLs from the platform side make debugging painful. Decode here, see the actual target.
Audit production URLs for double-encoding. A common bug — %2520 instead of %20. The decoder makes it visible (the result has a literal % in it).
URL encoding in Java, Python, and JavaScript
The tool matches JavaScript’s encodeURIComponent by default. In code:
encodeURIComponent("a b&c"); // "a%20b%26c" (JavaScript)
from urllib.parse import quote, quote_plus
quote("a b&c") # "a%20b%26c" (path/segment)
quote_plus("a b&c") # "a+b%26c" (form data)
URLEncoder.encode("a b&c", "UTF-8"); // "a+b%26c" (Java — space is +)
The gotcha across languages is space handling: JavaScript and RFC 3986 use %20, while Java’s URLEncoder and form encoding use +. For path segments, always normalise to %20. Paste your value here to see the RFC-correct output before committing to a library call.
Encoding SVG for data URIs
To inline an SVG in CSS without a separate request, URL-encode it into a data URI:
background: url("data:image/svg+xml,%3Csvg xmlns='...'%3E%3C/svg%3E");
Prefer URL encoding over base64 for SVG: the markup stays readable, compresses better, and the data URI is smaller. Paste the raw <svg> and copy the encoded string straight into the url().
Why encoding is still a footgun
Every modern framework abstracts URL building. Most do it correctly. The bugs surface at boundaries — a hand-rolled URL string concatenation, a webhook payload from a less-careful service, a query parameter passed through three systems each making different assumptions. Having a tester one tab away closes the diagnosis loop fast.
Frequently asked questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI assumes the input is a full URL and leaves :/?#[]@!$&'()*+,;= alone. encodeURIComponent escapes those, so it is correct for individual values you are stuffing into a URL component (a query value, a path segment).Why is my space encoded as <code>%20</code> not <code>+</code>?
%20 is the universal percent-encoding for space. + is the form-encoded variant used in application/x-www-form-urlencoded. Both decode to space; %20 is safe everywhere, + is path-context-only-questionably.Can I edit a URL's query parameters?
What about UTF-8 characters?
café becomes caf%C3%A9. The decoder reverses it cleanly.Are uploads or batch decodes sent anywhere?
How does batch mode work?
How do I URL-encode an SVG for a CSS background or data URI?
background: url("data:image/svg+xml,…"). Prefer URL encoding over base64 for SVG: it stays human-readable, gzips better, and produces smaller data URIs. Only #, %, quotes, and <> strictly need escaping, so the result is far shorter than a base64 blob.How do I URL-encode in Java, Python, or JavaScript?
encodeURIComponent(value). Python: urllib.parse.quote(value) (use quote_plus for form data). Java: URLEncoder.encode(value, "UTF-8") — note Java encodes space as +, so replace with %20 for path segments. This tool matches the JavaScript semantics by default.Related tools
Last updated: 2026-07-04