Text to URL Encoding Converter – Percent-Encode Your Text

What URL encoding is

URLs only allow a small set of safe characters: letters, digits, and a few symbols like the hyphen and the dot. Everything else, spaces, the ampersand, the question mark, accented letters, and many more, must be turned into a percent code before it can travel in a URL. A space becomes %20, an ampersand becomes %26, and an accented e becomes %C3%A9. That is URL encoding, also called percent-encoding.

Without it, a link breaks. A space in a link gets cut off or turned into a mess by the browser, and an ampersand inside a value gets read as the start of a new value. Encoding keeps each character in its place, so the link means what you meant. Every browser does this behind the scenes when you type a search, and every developer meets it when they build links with user input.

How to use the converter

Type or paste your text in the first box and press Encode. The result appears in the second box, with every unsafe character turned into a percent code. Press Decode instead to turn encoded text back into plain words: paste something like hello%20world and you get hello world back.

The tool also counts how many characters needed encoding, so you can see at a glance how much of your text changed. Press Copy result to put the output on your clipboard, ready to paste into a link, a form, or a line of code.

Worked example

Take the text hello world. It has 11 characters, and one of them, the space, needs encoding. The result is hello%20world, which has 13 characters. The space became %20, and the letters stayed the same.

Take the text a and b equals c, written as a&b=c. It has 5 characters, and two of them need encoding: the ampersand becomes %26 and the equals sign becomes %3D. The result is a%26b%3Dc, which has 9 characters. Without encoding, a browser would read the ampersand as a separator and split the value in two. Take the word cafe with an accent, written as cafe with the e accented. That letter becomes %C3%A9, so the result is caf%C3%A9.

Who uses this converter

Web developers use it most, when they build links that carry search words, names, or form values. A search for red shoes needs the space encoded before it goes into the link, and a name with an apostrophe needs the same treatment. Marketers use it when they build tracking links, where a campaign name with spaces would break the link.

It also helps anyone pasting a long link into a message or a document, where a raw link with spaces looks broken. Encoding first gives a clean link that works everywhere it is pasted.

Honest limitations

This tool encodes text the standard way, with encodeURIComponent, which leaves letters, digits, and the marks hyphen, underscore, dot, exclamation, tilde, asterisk, apostrophe, and parentheses alone. Other tools sometimes encode more or less, so a result from here can look slightly different from a result elsewhere, and both can be correct.

The tool also cannot tell you whether a whole URL is valid. It only encodes the text you give it. If you paste a full link, it will encode the slashes and colons too, which you do not want. Encode only the part that goes inside the link, like a search word or a value, not the whole address.

Frequently asked questions

Why is a space %20 and not a plus sign? In a URL path, a space is %20. In a form value, a space is often written as a plus sign instead. Both are common, but %20 is the safe choice for a link.

What does %C3%A9 mean? It is the letter e with an accent, stored as two bytes in UTF-8. Each byte becomes a percent code, so one accented letter becomes six characters in the URL.

Can I decode text with a broken code? No. A percent sign must be followed by two hex digits. A lone percent sign, or a code like %2, is not valid, and the tool tells you instead of guessing.

Is my text sent anywhere? No. The conversion runs in your browser, and nothing you type leaves your device.

También disponible en español: Convertidor De Texto A Codificación URL – Codifica Tu Texto En Porcentaje

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top