URL Encode / Decode

Encode text for safe use in a URL, or decode a percent-encoded URL back to plain text.

Output will appear here.

What This Tool Does

This tool percent-encodes text so it can be safely used inside a URL, and decodes percent-encoded text back to its original form. It supports two modes: Component encoding, for a single value like a query parameter, and Full URI encoding, for an entire URL where structural characters need to stay intact.

How to Use It

Choose Component or Full URI mode, paste your text into the input box, then click Encode or Decode. Component is the default and correct choice for the vast majority of use cases — encoding a value you're about to put into a query string.

The Formula

Component mode uses the browser's native encodeURIComponent / decodeURIComponent, which escapes every character that isn't safe inside a single URL component, including /, ?, &, and :. Full URI mode uses encodeURI / decodeURI, which leaves those structural characters alone and only escapes characters that would never legally appear anywhere in a URL, like spaces.

A Worked Example

Encoding a b&c=d é in Component mode produces a%20b%26c%3Dd%20%C3%A9— every special character, including the & and =, gets escaped, which is exactly right for a value you're inserting into a query string. Encoding the full URL https://example.com/a b/path?x=1&y=2 in Full URI mode instead produces https://example.com/a%20b/path?x=1&y=2 — only the space is escaped, while ://, /, ?, and &are left alone since they're structurally meaningful to the URL as a whole.

Component vs. Full URI: Why It Matters

Using the wrong mode is a common source of broken URLs. Run that same full URL through encodeURIComponent instead of encodeURI, and the result is https%3A%2F%2Fexample.com%2Fa%20b%2Fpath%3Fx%3D1%26y%3D2 — the :// and /characters that need to stay intact for the URL to work get escaped too, which is exactly wrong unless you're embedding that whole URL as a single value inside another URL's query string (a redirect target, for example). The rule of thumb: use Component mode for a single value going into a query parameter, and Full URI mode only when you're encoding an entire, standalone URL.

FAQ

Which mode should I use — Component or Full URI?
Use Component mode (the default) for a single value like a query parameter. Use Full URI mode only when encoding an entire, standalone URL, since it preserves structural characters like :, /, and ?.
Why did encoding my URL break it?
This usually happens when Component mode is used on a whole URL — it escapes the :// and / characters that need to stay intact. Switch to Full URI mode for a complete URL.
Is my text sent to a server?
No, all encoding and decoding happens directly in your browser. Your text never leaves your device.