URL Encode
Percent-encode any text so it's safe to use inside a URL path or query string, replacing spaces and special characters with their encoded equivalents.
- Free
- No signup
- Private
Overview
Percent-encode any text so it's safe to use inside a URL path or query string, replacing spaces and special characters with their encoded equivalents.
Benefits
- Correct percent-encoding for URLs
- Instant, browser-based conversion
- No data sent to a server
- Handles special characters and spaces
Use Cases
- Building query string parameters
- Encoding search terms for a URL
- Preparing values for API requests
- Fixing links broken by special characters
Users Also Use
How to Use
- Enter the string you want to encode.
- Click Encode.
- Copy the percent-encoded result for use in a URL.
What is URL encoding?
URL encoding, also called percent-encoding, replaces characters that are not allowed or have a special meaning in a URL with a % sign followed by two hexadecimal digits. A space becomes %20, & becomes %26, and = becomes %3D. Non-English characters are first converted to UTF-8 bytes, and each byte is encoded, so é becomes %C3%A9.
Which characters are encoded?
This tool uses JavaScript's encodeURIComponent(). It leaves letters A–Z and a–z, digits 0–9, and the characters - _ . ! ~ * ' ( ) unchanged, and encodes everything else, including spaces and the URL separators : / ? # & = +.
Worked example
Input: café & crème
Output: caf%C3%A9%20%26%20cr%C3%A8me
Used in a link:
https://example.com/search?q=caf%C3%A9%20%26%20cr%C3%A8me
Encode the value, not the whole URL
Because separators like / ? and = are encoded too, pasting an entire URL gives a string that no longer works as a link. That is only what you want when the whole URL is itself a parameter value, such as a redirect=… or url=… parameter. Normally, encode each query value on its own and then put the URL together.
%20 or +?
This tool encodes a space as %20, which works everywhere in a URL. HTML forms submitted with GET use + for spaces in the query string, and most servers accept both there. Inside the path part of a URL, + is a literal plus sign, so %20 is the safe choice.
Related tools
Use URL Decode to turn an encoded string back into readable text. To make a whole URL safe to paste into HTML, use HTML Encode. Encoding runs in your browser.
FAQ
- What is percent-encoding?
- It replaces unsafe or reserved characters (like spaces and &) with a % followed by a hex code, so they can safely appear in a URL.
- Why does a space become %20 or +?
- %20 is the standard percent-encoding for a space in a URL path; a + is sometimes used specifically in query strings. Check which your target system expects.
- Is my text sent to a server?
- No. Encoding happens entirely in your browser.
- Why does my space become %20?
- A space is not allowed in a URL, so it is replaced with % and its character code in hexadecimal, 20.
- Should I encode the whole URL?
- Usually not. Encode only the parts that go into a query value or path segment, otherwise characters like / and ? stop working.
- What is the difference between URL encoding and Base64?
- URL encoding keeps text readable and changes only unsafe characters. Base64 turns any data into a different 64-character alphabet.
- Is the text sent to a server?
- No. Encoding happens in your browser.