URL Encoder
Percent-encode URLs and query string components instantly
Input
Output encodeURIComponent
URL Encoding Examples
Spaces become %20, & becomes %26, = becomes %3D, and so on. The two modes differ in which characters they preserve:
encodeURIComponent (Component mode)
Input:
Output (Component mode — encodes : / ? & =):
Output (Full URL mode — preserves URL structure):
What Is URL Encoding?
URL encoding (percent encoding) converts characters that are not allowed or have special meaning in URLs into a % followed by two hexadecimal digits. It is defined in RFC 3986. For example, a space becomes %20, & becomes %26, and = becomes %3D. This ensures that data passed in URLs is transmitted correctly regardless of the character set.
This tool offers two modes matching JavaScript's built-in functions: <strong>Component mode</strong> uses <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent" target="_blank" rel="noopener"><code>encodeURIComponent()</code></a> which encodes everything except <code>A–Z a–z 0–9 - _ . ! ~ * ' ( )</code>. Use this for individual query parameter values. <strong>Full URL mode</strong> uses <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI" target="_blank" rel="noopener"><code>encodeURI()</code></a> which preserves URL structure characters like <code>:</code> <code>/</code> <code>?</code> <code>&</code> <code>#</code>. Use this for complete URLs. To decode, use the URL Decoder.
How to Use This Tool
Choose Encoding Mode
Select Component to encode a query parameter value (e.g., a search term). Select Full URL to encode a complete URL while keeping its structure intact. Click Sample to load an example.
Paste Your Input
Type or paste your text into the left editor. The right panel updates automatically with the percent-encoded output. Encoding runs entirely in your browser—no data is sent to any server.
Copy or Download
Click <strong>Copy</strong> to put the encoded string on your clipboard, or <strong>Download</strong> to save it as a <code>.txt</code> file. To reverse the process, use the URL Decoder.
Component vs Full URL Mode
For query string values always use Component mode. For example, if the search term is rock & roll, the correct query parameter is q=rock%20%26%20roll—not q=rock & roll which breaks the query string structure.
Frequently Asked Questions
Is my data private?
Yes. Encoding runs entirely in your browser. No data is sent to any server.
What is the difference between %20 and + for spaces?
In the application/x-www-form-urlencoded format (HTML form submissions), spaces are encoded as +. In standard percent encoding (RFC 3986), spaces are encoded as %20. This tool uses %20. If you need + for form data, replace %20 with + after encoding.
Which mode should I use for a full URL?
Use Full URL mode (encodeURI) when encoding a complete URL you want to keep navigable. Use Component mode (encodeURIComponent) when encoding a value that will be placed inside a query parameter, path segment, or fragment.
Does it support Unicode characters?
Yes. Non-ASCII characters like é, 中, or emoji are first encoded to UTF-8 bytes and then percent-encoded. For example, é becomes %C3%A9.
Related Tools
For the specification, see RFC 3986. MDN covers encodeURIComponent and encodeURI in detail.