🔒 Runs entirely in your browser. Nothing is uploaded.
Using an AI agent or a script? Call this tool as an API
AI agents and scripts can call this tool directly, to check their work or look something up, and get JSON back with the same answer this page gives. No key needed.
GET https://digitalgreenhouse.com.au/api/tools/url-encode?text=caf%C3%A9%20%26%20cake%3F&mode=encode
text— string, required. Text to encode or decode.mode— string, one ofencode|decode, defaultencode. encode or decode.scope— string, one ofcomponent|full, defaultcomponent. component = one query value or path segment; full = a whole URL.
The API answers from our server, and our code doesn’t store what you send. Fair-use limits apply. API guide · all endpoints (JSON) · OpenAPI
When do you need URL encoding?
URLs are only allowed to contain a limited set of characters. Spaces, ampersands, question marks, slashes, accented letters and emoji all have to be “percent-encoded” — a space becomes %20, an ampersand becomes %26, and so on — otherwise they break the link or get misread as URL structure. You’ll hit this whenever you build a link with user input, pass data in a query string, or share a URL with non-English text.
Component vs full URI
Component (encodeURIComponent) encodes nearly everything, including / ? & = — use it for a single value you’re dropping into a query string. Full URI (encodeURI) leaves the structural characters alone so a whole address stays usable — use it when you’re encoding an entire URL. This tool handles full Unicode correctly, so accented characters and emoji round-trip cleanly.
Why is a space sometimes %20 and sometimes +?
%20. In old-style HTML form submissions a space could be a +. This tool uses the modern %20 form, which is always safe.