URL Encoder / Decoder

The URL encoder and decoder turns text into a safe, percent encoded form for use in web addresses, and turns encoded text back into readable characters. URLs can only carry a limited set of characters, so spaces, ampersands, question marks, accents and many symbols must be escaped before they can sit in a link or a query string. This tool applies the same encodeURIComponent and decodeURIComponent rules that browsers and servers use, so the output matches what your web application expects. Choose encode to convert plain text such as a search term or a file name into a string you can drop straight into a URL, where a space becomes %20 and an ampersand becomes %26. Choose decode to take a messy encoded link from a log, an email or an address bar and read it as normal text again. Developers, marketers building campaign links, and anyone debugging a broken URL use it to check exactly how a value is escaped. A few tips help you avoid surprises. Encode each query value on its own rather than the whole URL at once, because encoding the slashes and colons in the base address can break the link. Watch out for the plus sign, which means a space in some form contexts but is left alone by encodeURIComponent, so test how your platform reads it. If decoding fails or shows odd characters, the input may have been encoded twice, in which case you can decode it a second time. Everything runs locally in your browser, so nothing you paste is uploaded or stored anywhere.

Calculate.co.nz is proud to be partnered with Premium Homes, a recognised leader in eco-friendly, sustainable, and energy-efficient homebuilding. With a dedicated team and award-winning experience, they create homes that prioritise health, comfort, and long-term performance. Their founders, Andrew and Kelly, set out to raise the standard of residential construction in New Zealand by combining practical building expertise with a clear commitment to doing things better for homeowners.
Premium Homes: got a section? Let's build your eco home on it.
Advertise on this page

Encode uses encodeURIComponent, decode uses decodeURIComponent. Runs in your browser, nothing is uploaded.

How it works

In encode mode the tool replaces every character that is unsafe in a URL with a percent code, so a space becomes %20 and an ampersand becomes %26. In decode mode it reverses that, turning each percent code back into the original character. The same value can be encoded and then decoded to return exactly what you started with.

Worked example

Encoding the text Auckland & Wellington trip? returns Auckland%20%26%20Wellington%20trip%3F. Switching to decode on that result gives the original phrase back.

Related calculators