URL encoding is the process of converting special characters in URLs into a format that browsers and servers can correctly interpret.
Some characters like spaces, accents, & or = cannot appear directly in URLs. These must be encoded, for example, a space becomes %20.
Let's see how a URL looks before and after encoding, especially with accented characters and spaces.
html
https://example.com/search?q=readytools linksy
// encoded: https://example.com/search?q=readytools%20linskyhtml
https://example.com/page?name=János
// encoded: https://example.com/page?name=J%C3%A1nosYou should encode values whenever sending user input or special characters in a URL, such as from a search box or form.
If a URL in an HTML link contains parameters with spaces or special characters, it must be encoded to work correctly.
html
<a href="https://example.com/search?q=hello%20world">Search</a>JavaScript's built-in encodeURIComponent() function helps safely encode URL parameters so they work correctly in browsers and on servers.
html
encodeURIComponent("János & Kati")
// output: J%C3%A1nos%20%26%20KatiIf you receive already encoded text, you can decode it back to readable format using the decodeURIComponent() function.
html
decodeURIComponent("J%C3%A1nos%20%26%20Kati")
// output: János & Kati✨ Ask Lara — your AI study partner
Unlock personalized learning support. Lara can explain lessons, summarize topics, and answer your study questions — available from the Go plan and above.
Lara helps you learn faster — exclusive to ReadyTools Go, Plus, and Max members.