2026topopentools

URL Encode / Decode

Percent-encode text so it is safe to use in URLs and query strings, or decode an encoded URL back to readable text.

Component mode encodes every reserved character (use for a single query value or path segment).

Result appears here…

Understanding the URL Encode / Decode

URL encoding, also called percent-encoding, replaces characters that are unsafe or reserved in a URL with a percent sign followed by their hexadecimal byte values. This tool encodes text so it can travel safely inside query strings, paths, and form data, and decodes percent-encoded strings back to readable text. It is handy for building API requests, debugging redirect links, and inspecting tracking parameters. Everything is computed in your browser using native JavaScript, so the URLs and values you process never leave your machine.

How it works

The tool uses the browser's encodeURIComponent to convert characters outside the unreserved set (letters, digits, and - _ . ~) into UTF-8 bytes written as %XX. Multi-byte characters become several percent groups. Decoding uses decodeURIComponent to reverse this. A space becomes %20 in this component mode; the older application/x-www-form-urlencoded format instead uses '+', which this tool can also handle when toggled. Read encoded output as a single safe token suitable for one query parameter or path segment. All conversion happens locally, so no data is sent anywhere.

Worked example

Encoding "name=Jane Doe & co" returns "name%3DJane%20Doe%20%26%20co": the equals sign becomes %3D, each space %20, and the ampersand %26, so the value won't be mistaken for a new parameter. Encoding the euro sign "€" produces "%E2%82%AC", three percent groups because it is three UTF-8 bytes. Decoding "https%3A%2F%2Fa.com%2Fq%3Fx%3D1" restores "https://a.com/q?x=1". Use component mode for one value; full-URL mode preserves :// and separators.

Tips & common mistakes

  • Encode each query value separately; encoding a whole URL with component mode breaks :// and slashes.
  • Use encodeURIComponent-style encoding for values and encodeURI-style for entire URLs.
  • A literal '+' in form data means a space; encode real plus signs as %2B to avoid ambiguity.
  • Always encode user input before putting it in a URL to prevent broken links and injection.
  • Double-encoding (%2520 instead of %20) is a common bug; decode once and check before re-encoding.

Related tools

Frequently Asked Questions

What is URL encoding?

URL encoding (percent-encoding) replaces unsafe characters — like spaces, &, =, and non-ASCII letters — with a % followed by hex codes, so they can be safely included in a URL.

When do I need it?

Whenever you put user input or special characters into a URL or query string, such as search terms, names, or parameters.

Is my input stored?

No. Everything is processed locally in your browser.