# URL Encode & Decode - Free, Local

Page: https://hirantha.me/tools/url-encoder
Part of: Hirantha Sandaruwan Lakshan free tools (https://hirantha.me/tools)
Updated: 2026-07-31

Percent-encode text for a URL, or decode it back.

This is a free tool that runs in the browser: open the page to use it. File tools process files on the visitor's own device; files are never uploaded or stored. No account, sign-up, payment or watermark.

Percent-encode text so it's safe to use inside a URL, or decode an already-encoded URL back to readable text, entirely in your browser.

Certain characters, like spaces, ampersands, and question marks, have special meaning inside a URL and need to be percent-encoded when they appear inside a value, such as a query parameter.

Encoding uses encodeURIComponent, which escapes everything except letters, digits, and a small set of characters safe in any part of a URL - the right choice for encoding a single value rather than a whole URL.

Decoding reverses the process, converting %XX sequences back to their original characters.

Q: Is my text uploaded anywhere?
A: No, encoding and decoding both run entirely in your browser tab.

Q: Should I encode an entire URL or just a value?
A: Just the value going into a query parameter or path segment - encoding an entire URL would also escape characters like : and / that need to stay literal.

Q: What happens if I decode text that isn't percent-encoded?
A: Plain text with no % sequences passes through unchanged, since there's nothing to decode.

Q: Why does decoding sometimes fail?
A: A malformed percent sequence, like a stray % not followed by two hex digits, isn't valid encoding and is reported as an error rather than guessed at.

Q: What is the difference between encoding a whole URL and a single value?
A: Encoding a whole URL leaves structural characters like : / ? & intact. Encoding a single value escapes them too, which is what you want for something going inside a query parameter.

Q: Why do spaces become %20 sometimes and + other times?
A: %20 is correct percent-encoding anywhere in a URL. The + convention applies only to HTML form submissions. When in doubt, %20 is the safer choice.

Q: Do I need to encode non-English characters?
A: Yes. Characters outside the basic ASCII set have to be percent-encoded to travel safely in a URL, which is why an accented word turns into several % sequences.

Q: Is there a length limit for URLs?
A: The spec sets none, but browsers and servers impose their own, commonly around 2000 characters. Anything approaching that should be sent in a request body instead.

Sources: Percent-encoding - Wikipedia (https://en.wikipedia.org/wiki/Percent-encoding); encodeURIComponent() - MDN (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent)

Related tools:

- [Base64 encode & decode](https://hirantha.me/tools/base64.md): Convert text to Base64 and back, right in your browser.
- [JSON formatter & validator](https://hirantha.me/tools/json-formatter.md): Pretty-print, minify, and validate JSON with clear error locations.
- [URL parser](https://hirantha.me/tools/url-parser.md): Split any URL into protocol, host, port, path, query parameters and fragment. Decodes percent-encoding, flags tracking parameters and rebuilds the URL.
- [URL slug generator](https://hirantha.me/tools/slug-generator.md): Turn any title into a clean URL slug: lowercase, hyphens, no accents or punctuation. Options for stop words, a length limit, other scripts and one slug per line.
- [HTML entities encoder and decoder](https://hirantha.me/tools/html-entities-encoder.md): Encode text to HTML entities as names, decimal or hex and decode them back, with all 2,125 named references of the HTML standard and a table of the common ones.
