URL Encode
Percent-encode text so it can be dropped safely into a URL, query string, or form field without breaking the surrounding structure. Switch between component and full-URL modes with live output.
- Published
- Last reviewed
Tool Summary Answer Block
This tool accepts structured input and returns deterministic output in the browser with no server upload.
- Tool name
- URL Encode
- Input intent
- Provide source content to transform, validate, or analyze.
- Output intent
- Receive normalized output suitable for copy, reuse, or debugging.
- Example input
- hello world & friends
- Example output
- hello%20world%20%26%20friends
Component mode (encodeURIComponent) escapes every reserved character — use it for a single query value or path segment.
Already encoded? Switch to URL Decode
Tool Introduction
Percent-encode text so it can be dropped safely into a URL, query string, or form field without breaking the surrounding structure. Switch between component and full-URL modes with live output.
Tool Overview
URLs reserve a small set of characters for structural meaning (?, &, =, /, #, and others). When you want to put arbitrary text inside a URL — a search query, a path segment, a tracking parameter — you must percent-encode the reserved and non-ASCII characters so each unsafe byte becomes %XX. This tool offers two modes. Component mode wraps encodeURIComponent and escapes every reserved character, which is what you want for a single query value or path segment. Full-URL mode wraps encodeURI and leaves structural characters like :/?#& intact, so you can encode a whole address that contains spaces or Unicode. Non-ASCII text is encoded as UTF-8 first, so accents and emoji are handled correctly. Everything runs in your browser.
Use Cases
- Build a query parameter that contains spaces, ampersands, or symbols
- Encode a search term before appending it to an API endpoint
- Prepare a redirect or return URL passed as a query-string value
- Escape a path segment that includes reserved characters
- Encode UTM campaign values so analytics links stay valid
Input/Output Examples
hello world & friends
hello%20world%20%26%20friends
https://example.com/search?q=cafés & bars
https://example.com/search?q=caf%C3%A9s%20&%20bars
FAQ
What is the difference between encodeURIComponent and encodeURI?+
When should I URL-encode text?+
How are spaces encoded?+
Does it handle emoji and non-English characters?+
Explore More Tools
Discover related utilities in the Encoding category below.
Related tools
Handpicked utilities you might find useful