About the URL Encoder
Web addresses can only contain a limited set of characters, so spaces, ampersands, question marks and every non-English letter must be written as percent codes. This tool will URL encode text using either component rules, for a single query value, or full-URL rules, for a complete address: a search for lawn suits & dupatta becomes lawn%20suits%20%26%20dupatta. Encoding the ampersand matters, because an unencoded one would split the value into two parameters. To read encoded addresses, use the URL Decoder, and to examine a whole link, the URL Parser.
There are two modes because the correct output depends on where the text will end up. Component mode escapes every character that could disturb one query value, the ampersand, equals sign and slash among them, and it is the one to use when encoding one parameter. Full-address mode leaves the punctuation that gives a URL its structure untouched, escaping only spaces, accented letters and other unsafe characters, so a complete address keeps working.
Choosing the wrong mode is the most common way encoded links break. Encoding a whole address in component mode changes every slash into %2F, producing a link that leads nowhere. Encoding one value in full-address mode lets its ampersands through untouched, so the value splits into two parameters as soon as the server reads it. Encoding the same text twice is a common mistake, because the percent sign itself becomes %25 and the link stops working.
How to use the URL Encoder
- Enter the text or addressPaste the value or the full link you want to encode, including any accented letters, spaces or symbols.
- Pick the modeComponent for one query value, full address for an entire URL that should keep working as a link.
- Read the outputThe encoded version updates while you type, so you can watch exactly which characters get changed into percent codes.
- Copy it into your linkPress the copy button and paste the result where you need it.
URL Encoder features
- Component mode for individual query values
- Full-address mode that keeps a URL's structure intact
- Optional + for spaces, as web forms send them
- Accented letters and non-Latin scripts encoded correctly
- Output that updates as you type
- One-click copy
Common uses
- Building search or tracking links from user input
- Putting one address safely inside another as a redirect target
- Hand-crafting query parameters when trying out an API in the browser
- Repairing links broken by spaces or symbols
- Making file names with accents safe for a link
URL encoding in practice: WhatsApp order links, mailto subjects, campaign tags, return addresses and file names with spaces
Any text placed in a link, such as a prefilled message, a search term, an email subject or a return address, must be encoded so that spaces, ampersands and non-English letters do not break the link. This guide builds a WhatsApp order link with a prefilled message and covers email links, campaign tags, return addresses and the open redirect risk, encoding once rather than twice, and file names with spaces.
A worked example: a WhatsApp order link
A clothing shop wants a button that opens WhatsApp with a ready-made message. WhatsApp's click-to-chat links use the number in international format without a plus sign or leading zero, followed by a text parameter: https://wa.me/923001234567?text= and the encoded message. The message Assalam o Alaikum, I want to order 2 kurtas (size M) & pay on delivery encodes in component mode to a string beginning Assalam%20o%20Alaikum%2C%20I%20want..., with the ampersand becoming %26. Without encoding, the ampersand would cut the message short at pay on delivery.
Email links with subjects
A mailto link can prefill the subject and body, such as mailto:info@example.com?subject=Order%20enquiry. Encode spaces as %20 rather than plus signs here, because some email apps display plus signs literally. Line breaks in the body are encoded as %0D%0A.
Campaign tags
UTM parameters label traffic from campaigns in analytics. Values with spaces and capitals, such as Summer Sale, must be encoded and appear inconsistently in reports. Lower-case values joined with hyphens, such as summer-sale, need no encoding and keep reports tidy.
Return addresses
Login pages often carry the page to return to, such as ?next= followed by an address. That address must be encoded as a component, so /checkout?step=2 becomes %2Fcheckout%3Fstep%3D2; otherwise its question mark and ampersands merge with the login page's own parameters. The receiving code should also check that the destination belongs to your own site, or attackers can use the parameter to bounce visitors to malicious pages.
Encode once
Encoding a value that is already encoded turns each percent sign into %25, producing addresses that show %2520 instead of spaces. In code, build links with functions designed for the job, such as encodeURIComponent or URLSearchParams in JavaScript, and apply them exactly once, at the point where the URL is assembled.
Urdu in links
Urdu words in addresses and parameters are encoded as sequences of UTF-8 bytes, so a single Urdu word can become dozens of characters. Browsers display the readable form in the address bar but copy the encoded form. For shareable page addresses, short English or transliterated slugs are easier to share and read in printed material.
File names with spaces
Uploaded files named Fee Schedule 2026.pdf produce links containing %20, which look messy and break when people copy them partially. Renaming files with lower-case words and hyphens, such as fee-schedule-2026.pdf, before uploading avoids encoding altogether and makes links readable.
Testing links
After building a link, click it on a phone as well as a computer. Check that the full message, subject or parameter arrived intact, especially any part after an ampersand, hash or question mark, which are the characters most likely to cut a value short when encoding is missed.
Common mistakes
- Leaving ampersands unencoded in prefilled messages.
- Using plus signs for spaces in mailto links.
- Encoding values twice.
- Accepting any return address without checking it.
Related tools
To read encoded links, use URL Decoder. To build chat links directly, try WhatsApp Link Generator, and to tag campaign links, UTM Builder.
Hash signs in values
A hash sign starts the fragment part of a URL, and browsers never send the fragment to the server. A value containing a hash, such as Order #1042 in a prefilled message, loses everything from the hash onwards unless it is encoded as %23. Component mode handles this, which is one reason to use it for every value.
Plus signs in phone numbers
In query strings, an unencoded plus sign is often read as a space, so a phone number written as +923001234567 in a parameter can arrive as a space followed by the digits. Encoding the plus sign as %2B, or leaving it out where the receiving system expects international digits only, keeps numbers intact.
Links printed as QR codes
Once a link is printed on a flyer as a QR code, mistakes cannot be corrected. Encode the link properly, test the code with several phones and check that every parameter arrives intact before printing hundreds of copies. Short links are also easier for phone cameras to scan reliably.
Keep links reasonably short
Browsers accept very long addresses, but some apps, email clients and older systems cut them off, and long links are hard to share. Keeping prefilled messages short and links under about two thousand characters avoids truncation and keeps messages pleasant to receive.
Privacy
Encoding runs in your browser. Your text is not uploaded or stored.
Further reading: Base64, URL Encoding and Hashing: What Is the Difference?.
Frequently asked questions
When should I choose component mode?
Pick it for any lone piece of data destined for the query string: what a user typed into search, an email address, or a link you are passing to another page. Use full-address mode only to tidy up a complete link while keeping its slashes and question mark working.
Why is a space sometimes %20 and sometimes +?
%20 is the standard way to write a space in a web address. The plus sign comes from HTML forms, which have long used it for spaces in submitted data. Both appear in real links, so the plus option is available.
Do hyphens and underscores need encoding?
No. Letters, digits, the hyphen, the underscore, the full stop and the tilde are always safe in a web address, so neither mode ever changes them.
What happens to letters from other languages?
Each character is first converted to UTF-8 bytes, and every byte is then written as a percent code. So é turns into %C3%A9, and most Chinese characters turn into three such codes.
Does encoding make a link private or secure?
No. Encoding only makes sure the characters survive the journey intact. Links end up in browser history, analytics reports and server logs, so never put anything confidential in one.
Can I encode a whole query string in one go?
Encode each value on its own in component mode, then join them with = and & yourself. Encoding the entire string at once would escape those separators too and turn the query into one meaningless value.