Text to URL encoding Converter – Free, Online, Private
Percent-encode a string with encodeURIComponent so it can sit in a query value. Spaces become %20, not +.
How to convert Text to URL encoding
- Paste the raw text, including spaces and reserved characters.
- Every character except the unreserved set is percent-encoded as UTF-8.
- Copy the result into a query value. Encode a whole URL only if you mean to hide its structure.
Component, not a full URL
encodeURIComponent escapes everything except A–Z, a–z, 0–9, hyphen, underscore, dot and tilde. Slash, question mark, ampersand, equals, space and non-ASCII are escaped. That is the right function for one query value. It is the wrong function for a whole URL, because it also escapes the :// and the path slashes, and the result will not navigate. The sample a b/c?x=1&y=ä becomes a%20b%2Fc%3Fx%3D1%26y%3D%C3%A4. The space is %20. The ä is the two UTF-8 bytes C3 A4. A plus sign in the input is %2B, so it cannot be confused with a space later.
Spaces
HTML forms historically used + for a space in application/x-www-form-urlencoded. This page does not. Query values built in JavaScript almost always use %20. The decode page accepts both: it turns + into a space before decoding, so a string you encoded here still round-trips, and a form body you paste there also becomes spaces. If a server library expects +, replace %20 after copying, knowing you will also change a real plus that was encoded as %2B only if you replace carelessly. Do not replace plus signs that are already %2B.
Worked example
The sample has a space, a slash, a question mark, an equals, an ampersand and ä. Each of those would split or extend a query if you pasted them raw. After encoding, the whole sample is one value. Decoding it returns the same characters, including ä. A character such as emoji becomes its UTF-8 percent sequence, four bytes for a typical emoji, not a single %u escape. %u is not produced. Older APIs that want %uXXXX are not this function.
Already encoded text
Encoding a second time turns %20 into %2520. If the input already contains percent escapes you want to keep, do not run it through this page. Decode first if you are unsure, then encode once. The page does not try to detect an already encoded string, because a literal percent is also valid input and must become %25. The work stays in the browser.
Frequently asked questions
Is a space a plus?
No. Spaces become %20. The decoder accepts + as a space so form bodies still decode.
Will this encode a full URL?
It will, but the slashes and colon are escaped too. Encode only the component that needs it.
How is ä encoded?
As UTF-8: %C3%A4. The page does not use Latin-1 or %u escapes.
Is the text uploaded?
No.