How to URL-Encode Text Online for Free (2026 Guide)
Ever wondered why a link to a page called "my file.html" shows up as my%20file.html? That's URL encoding (also called percent-encoding): the mechanism that lets web addresses safely carry spaces, special characters, and non-English text. If you build links, work with query strings, share URLs containing odd characters, or debug why a link breaks, you'll run into it constantly. This guide shows you how to encode and decode URLs with our free URL Encoder / Decoder, explains when encoding matters, and clears up what it doesn't do.
What is URL encoding?
URLs were designed around a limited character set. Characters outside it — spaces, punctuation with special meaning (?, &, =), and non-ASCII text — must be converted into a safe form. URL encoding replaces each such byte with a % sign followed by two hexadecimal digits representing the byte value. So a space becomes %20, an ampersand becomes %26, and the letter é (two bytes in UTF-8) becomes %C3%A9.
Characters that are always safe — letters, digits, and - _ . ~ — are left untouched. Everything else in a URL component generally needs encoding.
Step 1: Open the URL Encoder / Decoder
Open our URL Encoder / Decoder in any browser. No signup, no installation — just an input box, encode/decode buttons, and an output area.
Step 2: Encode text to a URL-safe form
- Paste or type your text — for example, a search query like
black & white photosor a full URL containing spaces. - Click Encode.
- The output shows the percent-encoded version:
black%20%26%20white%20photos. - Copy the result with the copy button.
Try encoding a full address with query parameters, then compare which characters changed and which didn't. That comparison builds the intuition for what's reserved versus safe.
Step 3: Decode a URL back to readable text
- Paste an encoded URL — something like
https://example.com/search?q=caf%C3%A9%20menu. - Click Decode.
- The readable form appears:
https://example.com/search?q=café menu.
Decoding is genuinely useful when debugging: analytics tools, server logs, and shared links often display the encoded form, and decoding reveals what the user actually typed or clicked.
When do you actually need URL encoding?
- Query strings with special characters: a search term containing
&or=would corrupt the parameter structure unencoded — encoding keeps each value intact. - Non-English text in URLs: page titles in Urdu, Arabic, Chinese, or any non-Latin script must be percent-encoded to travel safely.
- Building links programmatically: whenever code assembles a URL from user input or variables, each component should be encoded (most languages have a built-in function for exactly this).
- Sharing links with spaces or punctuation: some chat apps and email clients mangle unencoded URLs; encoding makes them survive copy-paste.
- Debugging broken links: a 404 on a URL with special characters often traces back to encoding done twice — or not at all.
Common encoding examples to memorize
- space →
%20(in query strings you may also see+, an older convention for the same thing) &→%26·=→%3D·?→%3F#→%23(important: an unencoded#starts the fragment and truncates what the server receives)%itself →%25- é →
%C3%A9· emoji and CJK characters become longer multi-byte sequences
Mistakes to avoid
- Double encoding: encoding an already-encoded string turns
%20into%2520. If your output shows%25sequences, something was encoded twice. - Encoding the whole URL blindly: encoding
https://would mangle the:and/characters that structure the URL. Encode the components (path segments, query values), not the entire address at once. - Assuming encoding = security: URL encoding is a transport mechanism, not protection. It doesn't hide, encrypt, or sanitize anything — an encoded attack payload is still an attack payload. Never rely on it for security.
- Forgetting the fragment: anything after
#never reaches the server, encoded or not.
URL encoding vs. its cousins
- URL encoding vs. Base64: URL encoding escapes individual unsafe characters for web addresses (Base64 re-represents whole binary payloads as text). Different jobs.
- URL encoding vs. HTML encoding: HTML entities (HTML Encoder) make text safe to display inside a web page; URL encoding makes text safe to travel inside a web address. A string placed in both contexts may need both, applied in the right order.
- URL encoding vs. hashing: encoding is fully reversible; hashing is one-way. Never confuse the two.
Frequently asked questions
Is the URL encoder private?
Yes — all encoding and decoding happens locally in your browser. Nothing you paste is uploaded anywhere.
Why do some URLs show + instead of %20 for spaces?
In HTML form submissions (the application/x-www-form-urlencoded format), spaces are conventionally written as +. Elsewhere in URLs, %20 is the standard. Both decode to a space in their respective contexts.
Can I encode an entire URL at once?
You can, but usually shouldn't — it will encode the structural characters (:, /, ?) too. Encode just the parts containing unsafe characters.
Does URL encoding work for non-English text?
Yes. Characters are first converted to UTF-8 bytes, then each byte is percent-encoded — so Urdu, Arabic, emoji, and everything else round-trips correctly.
Try it now: Free URL Encoder / Decoder · Free HTML Encoder · Free Base64 Encoder